Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (7th_zorro, VoroneTZ, AndrewAMD, HoopyDerFrood), 1,285 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19053 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Having problems with Mirrors in Pro #92833
10/03/06 10:19
10/03/06 10:19
Joined: Sep 2005
Posts: 235
Switzerland - Zurich
sinnlos Offline OP
Member
sinnlos  Offline OP
Member

Joined: Sep 2005
Posts: 235
Switzerland - Zurich
Dear Conitec and fellow forum users

We are trying to have a mirror effect on the floor. We have the pro edition 6.40.5. We are using a view that is rendered on the floor texture (bmap_for_entity).
We could get it run on a level-block with the mirror flag. the result was ok, if u ignore that strange flickering or mirrored objects sometimes dissapear.


this is a screenshot of the wed-block-mirror with the mirror-code from the manual (view.portal)

But we need it to work on a MDL!
we managed it to modify the code for mirroring on mdl-entities. this is the result:

u can see that the mirror is working, but its like the view of the mirror is not correct. but it uses the same logic.
The MDL is just a simple plane with no segments. made in max with a simple UVW-Map (planar). then exported as MDL and resaved in MED. In Wed the Model entity has the position 0,0,0 and rotation is also 0. it uses a 1024*1024 tga texture.

What is wrong? can anybody help?

We have tried the mirroring also in another level.
in this level the floor is made of 76 polys but is flat, it also has a shader on it but it seems that this doesn't matter because the mirror reacts the same wrong way:


in this image u can see the painting on the wall is mirroring on the floor, but stretched and disorted.


in this image u can see the sliding door of the balcony mirroring on the floor, also stretched and disorted.

we need to know if this is an engine issue or if we are making something wrong.
here is the code:

Code:
 view 1st_person
{
layer = 1;
pos_x = 0;
pos_y = 0;
/*
pos_x = 0;
pos_y = 0;
size_x = 1024;
size_y = 1024;
aspect = 1;
offset_x = 0;
offset_y = 0;
ambient = 10;
fog = 10;
//genius = null;
*/
arc = 80;

}

view mirror
{
layer = -1;
pos_x = 0;
pos_y = 0;

//arc = 90;
}


action b_boden_parkett
{
my.polygon = on;
my.material = shad_b_bo_pa;




mirror.size_x = 1024;//bmap_width (spiegl);
mirror.size_y = 1024;//bmap_height (spiegl);
mirror.bmap = bmap_for_entity(my,0);

1st_person.portal = mirror;
mirror.noshadow = on; // unterdrücke Schatten im Spiegel
mirror.portalclip = on;
while (1)
{
wait(1);
proc_late(); // führe Funktion nach allen anderen aus - die Kamera muss vorher bewegt werden

mirror.genius = 1st_person.genius;
mirror.aspect = -1st_person.aspect; // klappe das Bild von oben nach unten um
//mirror.arc = 1st_person.arc;
mirror.fog = 1st_person.fog;
mirror.fog_start = 1st_person.fog_start;
mirror.fog_end = 1st_person.fog_end;

mirror.x = 1st_person.x;
mirror.y = 1st_person.y;
mirror.z = 2*1st_person.portal_z - 1st_person.z; // bewege die Kamera um das zweifache der Portal-Distanz nach unten.
mirror.pan = 1st_person.pan;
mirror.tilt = -1st_person.tilt; // klappe den vertikalen Kamerawinkel um
mirror.roll = -1st_person.roll;

mirror.visible = on;

}



we are posting in this section because we couldn't find any usable threads nor tutorials (office-example describes only level-blocks) in the forum and nothing in the manual (also only level-block example). zwecklos posted this problem in the scripting section, but we didn't get an answere there. here is the link to that thread

cheers sinnlos & zwecklos

Last edited by sinnlos; 10/03/06 10:26.
Re: Having problems with Mirrors in Pro [Re: sinnlos] #92834
10/03/06 11:47
10/03/06 11:47
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
A mirror example is in the office_terrain level from the levels archive. There were also some examples in AUM issues.

Also, regard the mirror restrictions: No entities below the mirror plane, not even partially. This excludes mirrors on MDL entities, and also mirrors on transparent sliding doors.

Version 6.50 however will support mirrors through hardware clip planes - then the above restriction does not apply anymore. Still, clip planes are not supported by all 3D cards.

Re: Having problems with Mirrors in Pro [Re: jcl] #92835
10/04/06 07:41
10/04/06 07:41
Joined: Sep 2005
Posts: 235
Switzerland - Zurich
sinnlos Offline OP
Member
sinnlos  Offline OP
Member

Joined: Sep 2005
Posts: 235
Switzerland - Zurich
dear jcl

thanks for your answer.
we will definatly check the office_terrain level and the examples in the AUM issues.

but there is something in your post we didn't quite understand:
by saying:

Quote:

Also, regard the mirror restrictions: No entities below the mirror plane, not even partially. This excludes mirrors on MDL entities, and also mirrors on transparent sliding doors.




do you mean, that it is not possible to get a mirror working on a MDL? (because the restriction excludes mirrors on mdl's)
or do you mean, that it is possible to have mirrors on mdl's? (but we have to be aware that no entity goes under the Mirror-MDL)
sorry for that stupid question, but we want to be sure.

cheers
Sinnlos & Zwecklos

Re: Having problems with Mirrors in Pro [Re: sinnlos] #92836
10/04/06 09:05
10/04/06 09:05
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
It depends:

You can have mirrors everywhere, also on MDLs, when you write your own mirror effect, using environment mapping or a shader. Many water mirrors by users were done this way.

However the engine's built-in mirror method uses the MIRROR flag, which is a block surface flag and thus naturally only available for blocks, not for MDLs.

We will abandon the MIRROR flag in the future, and use only effects and shaders for mirrors. They are a lot more flexible and work on any surface.


Re: Having problems with Mirrors in Pro [Re: jcl] #92837
10/04/06 15:33
10/04/06 15:33
Joined: Sep 2005
Posts: 235
Switzerland - Zurich
sinnlos Offline OP
Member
sinnlos  Offline OP
Member

Joined: Sep 2005
Posts: 235
Switzerland - Zurich
thx jcl

we've got it working now...
looks quite cool

check it out: lets rock a6

cheers

Sinnlos & Zwecklos


Moderated by  old_bill, Tobias 

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