Vertex Normals for Lightmap calculations
Hello,
I want to build a lightmap for my terrain. (I''m using heightmaps)
But which Triangles should I select to generate a vertex normal?
0 1 2
3 4 5
6 7 8
Ok. Now i want to calculate the Vertex Normal of 4. Which Triangles should I use to do this?
The Triangles 3,4,1 / 1,4,5 / 5,4,7 / 7,4,3 ? But when i take these, the result looks not very good. Please help
Construct your grid of triangles from the vertices. When this is done, loop through all the vertices, and average the normals of all faces that are used by that vertex. This will give you the results you require.
Let's see if I can draw this:
To get the vertex normal for vertex 4, average the surface normals of the following triangles:
314, 412, 425, 634, 647, 745
These are all the triangles that include vertex 4.
That should do it.
BTW, Yay to me for producing my first ever ASCII art!
EDIT: dammit, got the pic right, and screwed up my tags!
[edited by - blacksheep on September 3, 2003 4:22:06 PM]
Let's see if I can draw this:
0--1--2| /| /||/ |/ |3--4--5| /| /||/ |/ |6--7--8
To get the vertex normal for vertex 4, average the surface normals of the following triangles:
314, 412, 425, 634, 647, 745
These are all the triangles that include vertex 4.
That should do it.
BTW, Yay to me for producing my first ever ASCII art!
EDIT: dammit, got the pic right, and screwed up my tags!
[edited by - blacksheep on September 3, 2003 4:22:06 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement