Gamestudio Links
Zorro Links
Newest Posts
Price of entry with OrderDelay
by Zheka. 10/18/21 23:50
Easiest way to get 1m History?
by Grant. 10/18/21 22:31
Lapsa's very own thread
by Lapsa. 10/18/21 21:09
Is it possible to find robust systems?
by Mariano. 10/18/21 20:59
Orders not found
by dpn. 10/18/21 18:09
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 10/18/21 13:49
What are you working on?
by rayp. 10/17/21 12:01
AUM Magazine
Latest Screens
Tactics of World War I
Hecknex World
Scheherazade's Journey
Paradox Vector
Who's Online Now
11 registered members (Leohermoso, 3run, Lapsa, AndrewAMD, dpn, mk_1, Mariano, Grant, Quad, Dooley), 450 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mariano, KoenC, Cuttyflame, Chiller, Avedon
18694 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,344
Caucasus
3run Online
Senior Expert
3run  Online
Senior Expert

Joined: May 2009
Posts: 5,344
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
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