POV-Ray : Newsgroups : povray.advanced-users : Locating an Object : Re: Locating an Object Server Time
2 Nov 2024 05:19:40 EDT (-0400)
  Re: Locating an Object  
From: Margus Ramst
Date: 5 Apr 2000 07:35:19
Message: <38EB1745.79E68F56@peak.edu.ee>
"Greg M. Johnson" wrote:
> 
> Easy, cinch,  unless your object is a BLOB!
> 
> #declare MyObject =  .....................
> 
> #declare location= <0,0,0>+max_extent(MyObject)/2+min_extent(MyObject)/2;
> 
> Tada!  Won't work with blobs.
> 

min/max_extent only give the limits of the object's bounding box, and thus are
not foolproof with complex CSG either, most notably intersection.
Vector functions are the surest way to go, since every object transformation can
be represented with a vector function.
Furthermore, in MegaPov there is now a vtransform() function, the vector
equivalent of transform. This makes the required operation easy:

#declare T=transform{rotate ... translate ... etc}
#declare Object=sphere{<0,1,0>,1 transform T}
#declare Location=vtransform(<0,1,0>, T);

-- 
Margus Ramst

Personal e-mail: mar### [at] peakeduee
TAG (Team Assistance Group) e-mail: mar### [at] tagpovrayorg


Post a reply to this message

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