|
|
> Any suggestions on improving
> this or know of something that could break its centering ablity?
The only thing I can imagine which would break this method would be bad
bounding boxes like
sphere {
0,1
bounded_by { box { -<100,1,1>,1 } }
}
(not as a result of manual bounding as shown here, but as a result of
complex CSG). But I don't know a method which would not fail in that
case (aside from scanning the whole bounding box via trace...). And I
don't think it'll happen too often.
To make your code just that bit more handy, I'd shorten it into one
single macro a la:
#macro Scaled_Screen_Object()
which would rescale a given object and pass it to Screen_Object. This
would make your code more reusable. And of course
#local objMax = max_extent(container);
#local objMin = min_extent(container);
#local objdim = objMax-objMin;
could be shortened to
#local objdim = max_extent(container) - min_extent(container);
but that's not really necessary.
HTH,
Florian
Post a reply to this message
|
|