|
![](/i/fill.gif) |
To test the visibility of an object in a scene, the code for a testing
screen below has been provided by Gilles Tran. This code is for the POV-Ray
(left-handed) coodinate system (y = up). I would like to use this for a
(right-handed) scene built in Moray (z = up), but don't know how to rewrite
the code for the screen. All help will be kindly acknowledged :-)
//--start code--
#declare CamLoc = <0, .3, 0>;
#declare CamEye = <0.0, 6, 0.0>;
#declare CamSky = y;
#declare AspectRatio = 640/1000;
#declare CamZoom = 1.5;
camera {
location CamLoc
direction z*CamZoom
right x*AspectRatio
look_at CamEye
}
// --------------------------------------
// visibility test code by Gilles Tran,
// derived from work by
// John Van Sickle and Christoph Hormann
// --------------------------------------
#declare CamD=vnormalize(CamEye-CamLoc); // direction of camera view
#declare CamR=vnormalize(vcross(CamSky,CamD)); // to the right
#declare CamU=vnormalize(vcross(CamD,CamR)); // camera up
#declare Screen= // pseudo screen to test the visibility of an object
mesh{
triangle{0,x,x+y}
triangle{0,y,x+y}
translate -0.5*(x+y)
scale <AspectRatio,1,1>
translate CamZoom*z
matrix < CamR.x, CamR.y, CamR.z,
CamU.x, CamU.y, CamU.z,
CamD.x, CamD.y, CamD.z,
CamLoc.x,CamLoc.y,CamLoc.z >
}
//object{Screen pigment{rgbf<1,0,0,0.9>}}
//--end code--
--
All the best,
Thomas
Post a reply to this message
|
![](/i/fill.gif) |