|
|
Christoph Hormann wrote:
>
> The inside/outside of a triangle is determined by the order in
> which the vertices are given.
Only works reliably for me with the triangles enclosed in a mesh.
Comment out the "union {" in the following code and uncomment the "mesh
{" to see the difference.
BTW, for Impress, the normal, should you still need it, can be figured
like this:
#local Normal = vcross ( Ver2 - Ver1, Ver3 - Ver1 );
camera {
orthographic
location <5,5,-10>
look_at <5,5,0>
right 12*x
up 12*3/4*y
}
#local r0 = seed(123);
union {
#local c0 = 0; #while ( c0 < 10 )
union {
//mesh {
triangle { <-1,-1,1>, <-1,1,-1>, <1,1,1> }
triangle { <-1,-1,1>, <1,-1,-1>, <-1,1,-1> }
triangle { <-1,-1,1>, <1,1,1>, <1,-1,-1> }
triangle { <-1,1,-1>, <1,-1,-1>, <1,1,1> }
rotate <rand(r0),rand(r0),rand(r0)>*360
translate <rand(r0),rand(r0),rand(r0)>*10
}
#local c0 = c0 + 1; #end
texture {
pigment { rgb x }
finish { ambient 1 }
}
interior_texture {
pigment { rgb y }
finish { ambient 1 }
}
}
-Shay
Post a reply to this message
|
|