|
|
I'd put the inside_vector at the rough center of the Mesh.
Then use:
texture {TEXTURE Blue}
interior_texture {TEXTURE Red}
If the normals of all the triangles point away from the inside_vector
then the outside will be Blue and the other side Red.
If some of the triangle normals point toward the inside_vector then the
textures will be reversed.
Both can be used, it depends on what effect you want.
So the NORMAL of each triangle controls how the textures are placed.
The way a triangle is made will effect the normal. Triangle <A,B,C> will
have a different normal the the same Triangle <A,C,B>. What is neat is
that those normal vectors will be exactly oppsite. So if a triangle's
normal is pointing the wrong direction all you have to do is trade B&C.
The fun part,in a large mesh of triangles,is finding the BAD triangle.
Using <A,B,C>, the formula to calculate a normal:
Normal = vcross(A-C,A-B);
Hope this helps.
Have Fun!
Post a reply to this message
|
|