POV-Ray : Newsgroups : povray.general : Fitting object to orthographic screen : Re: Fitting object to orthographic screen Server Time
31 Jul 2024 02:18:43 EDT (-0400)
  Re: Fitting object to orthographic screen  
From: John VanSickle
Date: 19 Jan 2008 08:31:40
Message: <4791fbbc$1@news.povray.org>
Nekar Xenos wrote:
> "Chris B" <nom### [at] nomailcom> wrote in message 
> news: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'.

Although,

camera { orthographic
   right (Max-Min)*x
   up (Max-Min)*y
   direction z
   location <0,0,Min-1>
}

Is shorter code.

Regards,
John


Post a reply to this message

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