POV-Ray : Newsgroups : povray.advanced-users : visibility test screen for right-handed system Server Time
29 Jun 2024 02:14:40 EDT (-0400)
  visibility test screen for right-handed system (Message 1 to 5 of 5)  
From: Thomas de Groot
Subject: visibility test screen for right-handed system
Date: 29 Sep 2009 09:46:11
Message: <4ac20fa3$1@news.povray.org>
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

From: clipka
Subject: Re: visibility test screen for right-handed system
Date: 29 Sep 2009 12:38:59
Message: <4ac23823$1@news.povray.org>
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

From: Thomas de Groot
Subject: Re: visibility test screen for right-handed system
Date: 30 Sep 2009 04:16:47
Message: <4ac313ef@news.povray.org>
"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.

No. Neither the one, nor the other, nor both :-(

Thomas


Post a reply to this message

From: Thomas de Groot
Subject: Re: visibility test screen for right-handed system
Date: 30 Sep 2009 04:45:37
Message: <4ac31ab1$1@news.povray.org>
"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

From: Thomas de Groot
Subject: Re: visibility test screen for right-handed system
Date: 30 Sep 2009 05:12:52
Message: <4ac32114$1@news.povray.org>
"Thomas de Groot" <tDOTdegroot@interDOTnlANOTHERDOTnet> schreef in bericht 
news:4ac31ab1$1@news.povray.org...
> Probably a very stupid error...

...it was...

Thomas


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.