POV-Ray : Newsgroups : povray.newusers : mesh of triangles: how to specify the back side? : Re: mesh of triangles: how to specify the back side? Server Time
28 Jul 2024 14:34:18 EDT (-0400)
  Re: mesh of triangles: how to specify the back side?  
From: Leroy Whetstone
Date: 13 Mar 2009 14:45:45
Message: <49BAA989.4090101@joplin.com>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.