POV-Ray : Newsgroups : povray.newusers : Calculate the camera position automatic : Re: Calculate the camera position automatic Server Time
4 Nov 2024 13:02:33 EST (-0500)
  Re: Calculate the camera position automatic  
From: Florian Brucker
Date: 8 Sep 2003 13:39:04
Message: <3f5cbeb8$1@news.povray.org>
Hi all!

> object{Object  translate <-Minimum.x,-Minimum.y,-Minimum.z> scale 
> (1/MaxLength)}

imagine a box:

	box { <1,1,1>,<2,2,2> }

Minimum would be <1,1,1>, Maximum <2,2,2>. translating it by:

	translate <-Minimum.x,-Minimum.y,-Minimum.z>

(which is btw the same as "translate -Minimum") would result in the 
following box:

	box { <0,0,0>,<1,1,1> }

this box is not centered at the origin.
This one is better:

	translate -(Minimum+Maximum)/2

(Minimum+Maximum)/2 is the center of the bounding box.

Rest looks fine (didn't test it though)

HTH,
Florian
-- 
//=================[web: http://www.torfbold.com]==================\\
#local a=-5;#while(a<5)sphere{<sin(a*pi)*5a*10pow(a,5)*.01>sin(a*a*a*
.1)+1pigment{rgb 9*z}}#local a=a+.01;#end camera{look_at-y*10location
<8,-3,-8>*10}// [www.povray.org]     [www.imp.org]     [www.irtc.org]


Post a reply to this message

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