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:23:50 EDT (-0400)
  Re: mesh of triangles: how to specify the back side?  
From: clipka
Date: 14 Mar 2009 12:05:00
Message: <web.49bbd54941fc54a24c2c4c080@news.povray.org>
"MelR" <nomail@nomail> wrote:
> For purpose of this discussion, you can consider the mesh to represent a
> rectangle oriented in space.  As part of this simplified example. I'd like one
> side to be red and the other side blue.  How is this specified?

Front/Back is controlled by the order in which you specify the corner points. So
given a triangle with the corner points A,B and C, the following are equivalent:

  triangle { A, B, C }
  triangle { B, C, A }
  triangle { C, A, B }

while these have front and back flipped:

  triangle { C, B, A }
  triangle { B, A, C }
  triangle { A, C, B }

I'm not sure right now whether the side from which the points appear to be
arranged clockwise is the front or the back - I'd have to test; I can also
imagine that it differs depending on whether you use a left- or right-handed
co-ordinate system. However, it will be consistent throughout your scene
(unless you use mirroring transformations of course).

Specifying the different colors is done using "texture" and "inside_texture",
even if your mesh is not fully closed and therefore does not have an "inside"
in the strict sense.

Note that within a single mesh object, you can only specify a single front/back
texture pair. Any texture specified for an individual mesh triangle (or even
vertex) will be applied to both sides (POV doesn't accept "inside_texture" at
this level), and override both any "texture" and "inside_texture" statements at
mesh object level.


Post a reply to this message

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