|
|
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
|
|