|
|
quote:
The reason for having more normals than vertices is so that adjacent faces
> can use different normals on the same vertices, creating sharp transitions
> between them (like at sharp edges of an object).
yes, i knew this. sorry, i think my question was phrased poorly. i know that
i have twice as many normals because im generating a square
ribbon(molecular modeling) and thus have sharp corners on the ribbon. my
question was actually regarding the format of povray's normal indices. i
have been trying to figure out how to write the code itself. i have the
normals and vertexs calculated correctly, but i need to figure out how to
lay out the index correctly. I know that if you dont specify a normal
index, it just takes the index from your faces. but when i specify a
seperate normal index, what is the format? for example, if i have 2 vertex
points and 4 normals, how do i tell povray that the first two normals go
with the first vertex, and the second two with the second vertex? what
would that index look like? (obviously this isnt the best example since its
not a triangle, but it illustrates my question). Thanks!
Ben
Post a reply to this message
|
|
|
|
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
|
|