Posted By: LazyDog
A6 Pro - Wall Mirror sorrows - 02/04/07 20:02
I have A6 pro and have successfully created a floor mirror by selecting the mirror flag in wed for the floor surface. I took the same level removed that flag and set a side wall surface flag to mirror. I don't understand the concepts of the portal view enough to alter the floor code to work on the wall. the following small scripts has the old floor code to show what was working and the new wall code. All that is displayed on the wall is a blue/purple color. can you please explain what I doing wrong?
Code:
Code:
//wallmirror.wdl
view aMirror
{
layer = -1;
}
function UpdateFloorMirror
{
camera.portal = aMirror;
aMirror.noshadow = on; // suppress shadows in the mirror
aMirror.portalclip = on;
aMirror.nocull = on;
aMirror.visible = on;
while (1)
{
proc_late(); // place at end of function list - camera must move first
aMirror.genius = camera.genius;
aMirror.aspect = -camera.aspect; // flip the image upside down
aMirror.arc = camera.arc;
aMirror.x = camera.x;
aMirror.y = camera.y;
aMirror.z = 2 * camera.portal_z - camera.z;
aMirror.pan = camera.pan;
aMirror.tilt = -camera.tilt; // flip the vertical camera angle
aMirror.roll = -camera.roll;
wait(1);
}
}
function UpdateWallMirror
{
camera.portal = aMirror;
aMirror.noshadow = on; // suppress shadows in the mirror
aMirror.portalclip = on;
aMirror.nocull = on;
aMirror.visible = on;
while (1)
{
proc_late();
aMirror.genius = camera.genius;
aMirror.aspect = camera.aspect;
aMirror.arc = camera.arc;
aMirror.x = aMirror.portal_x;
aMirror.y = aMirror.portal_y;
aMirror.z = camera.z;
aMirror.pan = camera.pan + 180;
aMirror.tilt = camera.tilt;
aMirror.roll = camera.roll;
wait(1);
}
}
function main()
{
level_load("wallmirror.wmb");
wait(3); // wait until level loaded
camera.arc = 135;
// UpdateFloorMirror();
UpdateWallMirror();
ent_create("warlock.mdl",Vector(-115,180,192),null);
while (1)
{
camera.x += key_force.y;
camera.y += key_force.x;
wait(1);
}
}


