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