|
|
On Wed, 22 Mar 2000 19:01:13 +0100, "Simen Kvaal"
<sim### [at] studentmatnatuiono> wrote:
>Given an object (for example an arbitrary isosurface). Is it any way to
>calculate, using for example trace, the lower y-coordinate, for example, so
>that I can place it as close as possible to the ground?
#macro Place_On_Earth ( Object, Steps ) // y is up :)
#local Min = min_extent ( Object );
#local Max = max_extent ( Object );
#local Increment = ( Max - Min ) / Steps;
#local X = Min.x; #local Continue=1; #local Y = Min.y;
#while ( (Y < Max.y) & Continue )
#while ( (X < Max.x) & Continue )
#local Trace = trace ( Object, <X,Y,Min.z>, z, Normal );
#if ( vlength (Normal)) #local Continue = 0; #end
#local X = X + Increment.x;
#end
#local Y = Y + Increment.y;
#end
object { Object translate -y * ( Y - Increment.y ) }
#end
It *might* just work a prima vista but I doubt it as I typed it
directly in the newsreader ;) Anyway, you get the idea.
Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] usanet
TAG e-mail : pet### [at] tagpovrayorg
Post a reply to this message
|
|