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:33:42 EDT (-0400)
  Re: mesh of triangles: how to specify the back side?  
From: MelR
Date: 13 Mar 2009 20:50:00
Message: <web.49bafe1a41fc54a2aa31c2b90@news.povray.org>
Thank you to all who replied.  Leroy, how a normal is defined by the given
sequence of triangle corners is something I've been looking for and have not
previously been able to find.  Your definition is clear except for one detail:
is the vector cross product a right or left-handed operation?  (Based on my
limited familiarity with povray, I'm assuming it is a left-handed operation
unless "right" has been specified, but I'm not certain.)

I will try the texture definitions as you've described.  Here, too, I've not
been successful in discovering where in the documentation these issues are
clearly discussed as they relate to triangles with both front and back textures
as part of a mesh.  I appreciate your effort to address this directly.

So far I have been using (flat) triangles and not "smooth triangles".  In my
efforts to far, povray has detected some compilation?/syntax? errors, but I
don't know yet if these are due to errors in my expressions or errors in my
understanding as to how an interior_texture applies to a (flat) triangle.  If
you are aware that these discussion do not apply to a (flat) triangle and I
must use a "smooth triangle" instead, please let me know.

I appreciate your assistance.
Mel



Leroy Whetstone <lrw### [at] joplincom> wrote:
> 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.