#### Archived

This topic is now archived and is closed to further replies.

# What's the deal with Triangle Strips and normals

This topic is 6257 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

What''s the deal with Triangle Strips in dx8? I mean, I understand how they work but what about normal vectors. If I understand correct all vertices needs a normal vector when you want to use lighting. And that normal vector should correspond to the face''s (which the vertex is a corner of) normal. Correct? But when you render with Triangle Strips, one vertex can be corner for several faces. How can the vertex normal be correct for all the faces? Isn''t it only possible to use Triangle Lists then, or is there a "fancy" way around this? I mean, Triangle Lists takes op alot of space and memory. Thanks in advance. Per Rasmussen. P.S. What is the best/smallest way to store models?

##### Share on other sites
Usually, you want a vertex normal to be the average of all the face normals of the faces that use that vertex. This will create smooth shading. This is good for smooth objects like spheres, but bad for cubes. One way to solve this problem is with degenerate triangles.

##### Share on other sites
degenerate triangles? Could you please explain that further?

##### Share on other sites
OK, let me see if I can explain this well...

Imagine we are talking about two sides of a cube and we want to use a triangle strip AND we want to use degenerate triangles (this may not be the best way, but we''ll run with it...)

Imagine the two sides are folded flat with 6 vertices total:

1....3....5
. . . . .
.. .. .
2....4....6

now, triangle 234 has a different normal than triangle 345, but both triangles share vertices 3 and 4. What to do?!? redo the strip as follows:

1....35...7
. . . . .
.. .. .
2....46...8

Now, set the normals of 3 and 4 to the normal for triangle 234 and set 5 and 6 to the normals for triangle 567.

There exists 2 triangles 345 and 456 that are effectively invisible and will feature interpolated shading, but again, they''re invisible. They''re only there to make the normals work.

In this case, this may not be the optimal solution because you are introducing more data, but you asked...

For highly tesselated models (basically, anything other than very simple geometry) the "vertex normal as the average of all shared face normals" way works like a charm.

Model storage:

It depends - file storage or vertex buffer storage.
vertex buffer - it depends on the format you need...
file - you can do anything you want depending on your needs and willingness to write file parsers. The binary .X files are fairly compact and easy to parse.

1. 1
Rutin
46
2. 2
3. 3
4. 4
5. 5
JoeJ
19

• 11
• 15
• 9
• 10
• 13
• ### Forum Statistics

• Total Topics
633004
• Total Posts
3009836
• ### Who's Online (See full list)

There are no registered users currently online

×