|
|
par### [at] fwicom (Ron Parker) wrote:
>
> You don't need an angle. You don't need to rotate or translate.
Unfortunately, I neglected to mention that I need to align a texture to
the plane (I omitted that from the code snippet for clarity), so I still
do need the information. I think I figured out what I did wrong,
though; it looks like this makes it work:
#macro safeatan(a,b) #if (a|b) degrees(atan2(a,b)) #else 0.0 #end #end
#macro MakePlane( a, b, c )
#local n = vnormalize( vcross( b-a, c-a ));
#local v1 = -(90-(safeatan(n.y,sqrt(n.z*n.z+n.x*n.x))));
#local v2 = (safeatan(n.x,n.z))-180;
#local d = <v1,v2,0>;
plane { y, 0 texture { whatever } rotate d translate c }
#end
--
Jeff Lee shi### [at] gatenet http://www.gate.net/~shipbrk/
Post a reply to this message
|
|