POV-Ray : Newsgroups : povray.general : normal indices in mesh2 : Re: normal indices in mesh2 Server Time
1 Aug 2024 16:32:01 EDT (-0400)
  Re: normal indices in mesh2  
From: Warp
Date: 4 Aug 2005 01:04:54
Message: <42f1a1f6@news.povray.org>
sokermaniac11 <sok### [at] hotmailcom> wrote:
> can anyone explain to me how the normal indices work in mesh2? i have 2
> normals for each of my vertex vectors, and i cant find a good documentation
> of how the normal_indices are supposed to be set up.

  Perhaps a well-commented example could help:


camera { location <0, 1.5, -3> look_at 0 angle 35 }
light_source { <5, 10, -1>, 1 }

mesh2
{ vertex_vectors
  { 4,
    <-1, -.5, 0>, // 0: leftmost vertex
    <0, 0, -1>,   // 1: mid vertex, closer to camera
    <0, 0, 1>,    // 2: mid vertex, farther from camera
    <1, -.5, 0>   // 3: rightmost vertex
  }
  normal_vectors
  { 6,             // Normal vectors for:
    <-1, .5, 0>,   // 0: leftmost vertex
    <-.5, 1, -.5>, // 1: mid vertex (closer to camera) for left triangle
    <-.5, 1, .5>,  // 2: mid vertex (farther from camera) for left triangle
    <.5, 1, -.5>,  // 3: mid vertex (closer to camera) for right triangle
    <.5, 1, .5>,   // 4: mid vertex (farther from camera) for right triangle
    <1, .5, 0>     // 5: rightmost vertex
  }
  face_indices
  { 2,
    <0, 1, 2>, // left triangle
    <1, 2, 3>, // right triangle
  }
  normal_indices
  { 2,
    <0, 1, 2>, // normals for left triangle
    <3, 4, 5>  // normals for right triangle
  }

  pigment { rgb 1 } finish { specular .5 }
}


-- 

                                                          - Warp


Post a reply to this message

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