|
|
I am trying to place a relatively flat object on a heightfield using the
following macros:
#declare Ground = height_field {
png "lakeb.png"
smooth
translate <-.5,-.5,-.5>
texture { texGnd }
scale <1e4, 160, 1e4>
}
#macro trnGnd( ob, ang, px, py, alt)
rotate y*ang
#local nrm = <0,0,0>;
#local ps = trace( ob, <px, 1e5, py>, -y, nrm);
#if (vlength(nrm)>.1)
Reorient(y,nrm)
#end
translate ps+nrm*alt
#end
// Coral is a parametric snake surface
object { Coral scale 1.0 trnGnd(Ground, -96, 216, -910, 0.45) }
The snake is rather long but lies relatively flat on a plane. When I try to
orient the snake so that is is level to the local surface, it fails
miserably. Some of it is above the surface and some is below. What am I
doing wrong?
Post a reply to this message
|
|