|
|
On Thu, 6 Jul 2000 22:24:08 +0200, Marc-Hendrik Bremer wrote:
>You could achieve this with the megapov-keywords min_extend and max_extend,
>if I get this right. How accurate are the bounding boxes of the 'primitive'
>pov-primitives like spheres, boxes, cones, cylinders? Is the object
>'centered' in there. I know this is not a accurate term, 'course where is
>the center? What I mean is: would min_extend.x and max_extend.x return -1
>and 1 for a sphere{0,1}, a box{-1,1}, a cone {<-1,0,0>,1,<1,0,0>,2}?
The keywords are min_extent and max_extent (t, not d.) I wrote the
implementation, so I should know.
They're generally pretty accurate for simple primitives, and in the four
cases you mentioned the object is centered in there. If you have rotated
the objects, the bounding box gets larger rather than rotating, so there's
likely to be some space for them to rattle around in the box.
CSG objects are likely to overbound, and some objects are just plain
unbounded (poly springs to mind.) I think it's probably better to just
know what you want the center of the object to be and keep it in mind while
you're designing it, then do any scales or rotations before translating
it to the final location. If you find it easier to work in terms of
local or global transforms, (e.g. you want to rotate the table after you
translate it where you need it) then use the macros I posted in that other
thread. (Remember to read the followup; it fixes an error.)
--
Ron Parker http://www2.fwi.com/~parkerr/traces.html
My opinions. Mine. Not anyone else's.
Post a reply to this message
|
|
|
|
Marc-Hendrik Bremer <Mar### [at] t-onlinede> wrote:
: But I wonder if it would be possible to write a macro which does the
: following:
: 1. Translate the Object which is specified by a parameter to the Origin
: (with whatever point one chooses for the non-existing origin of the object)
: 2. Rotate or scale or whatever the Object by a specified (through a
: parameter) amount
: 3. Translate the Object back to its place
Quite trivial, I think:
#macro LocalTransform(LocalOrigin, Transformation)
translate -LocalOrigin
transform { Transformation }
translate LocalOrigin
#end
The same for individual transformations (rotate, scale) if wished
: out where a Object is, say you have a sphere at <10,0,10>. Is it possible to
: get this vector from the "sphere-statement" (without declaring it
: previously)? Did not here about something like this yet.
As I said, objects do not have local origins.
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
|
|
|
Yes, reading more carefully I realize that I misunderstood a bit what
you were saying. I apologize if I offended you in any way.
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
|