POV-Ray : Newsgroups : povray.general : Fitting object to orthographic screen : Re: Fitting object to orthographic screen Server Time
31 Jul 2024 02:29:40 EDT (-0400)
  Re: Fitting object to orthographic screen  
From: Chris B
Date: 19 Jan 2008 05:45:16
Message: <4791d4bc@news.povray.org>
"Nekar Xenos" <nek### [at] gmailcom> wrote in message 
news:47919cc8@news.povray.org...
>I think this has been mentioned before, but I can't find the post. I'm 
>trying to fit objects' bounding box exactly to screensize. Can anyone 
>please tell me what I'm missing?
>
> camera { orthographic
>  location  CamPos
>  right (Max-Min).x
>  up (Max-Min).y
>  look_at  CamLook
> }
>

That should be
  right x*(Max-Min).x
  up y*(Max-Min).y

It took me quite some looking and head scratching to spot that one. :-)

'up' and 'right' are vectors and you're using a float (i.e. just the x 
dimension of the difference between the Max and Min extents of the object). 
This gets automatically expanded to a vector with equal values for x, y, and 
z, so you need to multiply by the appropriate vector (e.g. 'x') to get a 3D 
vector with just the 'x' component being '1' and the rest being '0'.

Regards,
Chris B.


Post a reply to this message

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