Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (degenerate_762, Nymphodora), 1,012 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Mirror in lite-c with A8 PRO #484324
10/09/21 15:18
10/09/21 15:18
Joined: Jan 2004
Posts: 2,062
Hamburg, Germany
slacer Offline OP
Expert
slacer  Offline OP
Expert

Joined: Jan 2004
Posts: 2,062
Hamburg, Germany
Hi all,

I installed my old A8 Pro again after a very long time and just wanted to create a simple scene with a real mirror in it.
This snippet from the manual does not even compile for me.
Code
// Code to emulate a horizontal mirror by generating a vertically flipped camera view
view mirror { }
function init_mirror_z()
{
  camera.portal = mirror;
 	mirror.noshadow = on; // suppress shadows in the mirror
 	mirror.portalclip = on;
 	while (1)
 	{
	  proc_late();   // place it at the end of the function list - the camera must be moved before
 	  mirror.genius = camera.genius;
 	  mirror.aspect = -camera.aspect;    // flip the image upside down
 	  mirror.arc = camera.arc;
 	  mirror.fog = camera.fog;
 	  mirror.x = camera.x;
 	  mirror.y = camera.y;
 	  mirror.z = 2*camera.portal_z-camera.z; //move the camera downwards by twice the portal distance
    mirror.pan = camera.pan;
 	  mirror.tilt = -camera.tilt; // flip the vertical camera angle
 	  mirror.roll = -camera.roll;
 	  wait(1);
  }
} 


The error message is:
Quote

A8 Egine - Pro Edition V8.47.1 - Mar 9 2016

Error in line 18:
'view' undeclared identifier
<view mirror {}>
Error E355: Startup Failure - any key to abort


Any ideas or a working sample?

I use the simple template with these header files:
Code
////////////////////////////////////////////////////////////////////////
// Template main script:
// Created by WED.
////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////
// entry: Start Level
// entry_help: Name of the level loaded at start
char* t_levelname = "sample.wmb";

////////////////////////////////////////////////////////////////////////
#include <acknex.h>
#include <default.c>
#include <atypes.h>
#include "t_player.h"


Kind regards
Michael

Re: Mirror in lite-c with A8 PRO [Re: slacer] #484334
10/10/21 12:08
10/10/21 12:08
Joined: Jan 2004
Posts: 2,062
Hamburg, Germany
slacer Offline OP
Expert
slacer  Offline OP
Expert

Joined: Jan 2004
Posts: 2,062
Hamburg, Germany
Seems I confused C-Script with Lite-C as this code is in the A6 manual in the C-Script section as well. frown But I still don't know how to do it in A8 PRO.

Re: Mirror in lite-c with A8 PRO [Re: slacer] #484337
10/10/21 12:44
10/10/21 12:44
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Hey!

There is a mirror shader in the mtlFX.c, check it out!
You can see how it works from the shaderTest.c (which can be found in GStudio8\projects\shadertest).

Greets.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Mirror in lite-c with A8 PRO [Re: slacer] #484338
10/10/21 13:41
10/10/21 13:41
Joined: Jan 2004
Posts: 2,062
Hamburg, Germany
slacer Offline OP
Expert
slacer  Offline OP
Expert

Joined: Jan 2004
Posts: 2,062
Hamburg, Germany
Great!
Thank you.


Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1