|
|
there is an error in the Vrand in Obj function that was provided with the
POV-RAY 3.5 beta 5 release.. the call to VRand_In_Box is improperly
formatted - Stream value should be last, rather than first.
the following code works correctly.
philip davidson
//a random point inside an arbitrary object
//Warning: can be quite slow if the object occupies a small
//portion of the volume of it's bounding box!
//Also, will not work on objects without a definite "inside".
#macro VRand_In_Obj(Obj, RS)
#local Mn = min_extent(Obj);
#local Mx = max_extent(Obj);
#local Pt = VRand_In_Box( Mn, Mx, RS);
#local J = 0;
#while(inside(Obj, Pt) = 0 & J < 1000)
#local Pt = VRand_In_Box( Mn, Mx, RS);
#local J = J + 1;
#end
(Pt)
#end
Post a reply to this message
|
|