|
![](/i/fill.gif) |
I thought about the subject again and found some new questions I can't
answer myself :)
The basic argument in the thread ABX provided a link to is, that CSG
objects are optimized for the used transformations, so that e.g.
sphere {
0, 1
scale 20
translate <-1,2,3>
}
is "translated" into
sphere { <-1,2,3>, 20 }
This is done to avoid the application of the transformation to the
incoming ray, right? This is not applicable on referenced objects, as
those would store their transformations separately.
Now I do see that this kind of optimization will work for simple objects
like a sphere, but does it still hold true, say, for a rotated box? A
sheared box? I don't know how the intersection tests are performed
internally, but I could imagine that there are (a lot?) of combinations
of objects and transforms for which it is not possible to perform
optimizations as above. So in that cases, the transformations would have
to be applied to the ray, wouldn't it? And applying the transformation
to the ray is a matrix*vector operation, right? So once you mixed one
transformation with an object which can't be optimized for that special
transformation, you will have to do the matrix*vector stuff, no matter
what any other transformations are applied to the object. In those
cases, the argument against referencing does not work.
Can anyone tell me how much of the usual intersection tests benefit from
this kind of optimization (I know that this is scene dependant, but just
to have an idea)?
Thanks for any pointers and sorry if I'm talking BS, just tell me :)
Florian
--
camera{look_at-y*10location<8,-3,-8>*10}#local a=0;#while(a<999)sphere{
#local _=.01*a-4.99;#local p=a*.01-5;#local c=.01*a-4.995;<sin(p*pi)*5p
*10pow(p,5)*.01>sin(c*c*c*.1)+1pigment{rgb 3}}#local a=a+1;#end
/******** http://www.torfbold.com ******** http://www.imp.org ********/
Post a reply to this message
|
![](/i/fill.gif) |