POV-Ray : Newsgroups : povray.text.scene-files : Fitting a box into the view (was Re: A simple geometry problem for you...) Server Time
17 May 2024 04:04:08 EDT (-0400)
  Fitting a box into the view (was Re: A simple geometry problem for you...) (Message 1 to 1 of 1)  
From: Vincent LE CHEVALIER
Subject: Fitting a box into the view (was Re: A simple geometry problem for you...)
Date: 14 Nov 2005 15:50:56
Message: <4378f8b0@news.povray.org>
JRG wrote on povray.off-topic:
> Suppose you have a bounding box, aligned with the axes. Then you have a 
> camera, placed in a known location, pointing towards a known 
> direction... and the up vector can be any direction. You also know the 
> horizontal and vertical FOVs. Now suppose you want to transform the 
> camera in order to make the bounding box fit the view as close as 
> possible. You want to preserve its original direction and FOV, thus 
> moving its location and its interest only.

And here goes a povray script showing my solution to this not-so-trivial 
problem ;-)

A sample result and a figure illustrating the algorithm are in 
povray.binaries.images.

I'm posting this in case anyone needs it in the future...

-- 
Vincent


Post a reply to this message


Attachments:
Download 'bb.pov.txt' (7 KB)

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