|
|
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
|
|
|
|
Thomas de Groot schrieb:
> 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;
I'd expect that setting either AspectRatio or CamZoom to a negative
value could do the job.
Post a reply to this message
|
|
|
|
"clipka" <ano### [at] anonymousorg> schreef in bericht
news:4ac23823$1@news.povray.org...
> I'd expect that setting either AspectRatio or CamZoom to a negative value
> could do the job.
Well, after some further testing, it appears that I do not have to change
the code at all! It works just fine either with right- or left-handed
scenes... This means something is wrong with my scene in the first place,
because the (uncommented) pseudo screen does not appear.... :-( Probably a
very stupid error...
Thomas
Post a reply to this message
|
|