# Thread: vertex normals

1. ## vertex normals

Hi, I want to use a Normal for each Point of my scene. Does anyone know how to calculate them? I've just worked with Normals for each Triangle, but that's not what I want ...
THANX

2. ## Re: vertex normals

Well actualy what is the good of those vertex normals , explain for beginner please..

3. ## Re: vertex normals

Hi !

There are a number of ways to cheat, but still look's ok, have a look at the Graphics Gems code to have a look on how it can be done, there is an example of code that calculates the vertex normals for a mesh of polygons.

Google should also give you a good set of hits.

Mikael

4. ## Re: vertex normals

Originally posted by Tea:
Well actualy what is the good of those vertex normals , explain for beginner please..
Hi !

If you have a sphere for example and just use surface normals (all vertex normals point in the same direction), you get a pretty ugly sphere (unless that's what you want) because you can see each triangle the sphere is built from.

If you calculate vertex normals you get a smooth sphere (or at least it look's smooth to som extent). because it makes the colors behave like the triangle is a curved surface.

You do this by modifing the vertex normals to average between the triangles that use that vertex.

Mikael

5. ## Re: vertex normals

Originally posted by mikael_aronsson:
Hi !

If you have a sphere for example and just use surface normals (all vertex normals point in the same direction), you get a pretty ugly sphere (unless that's what you want) because you can see each triangle the sphere is built from.

If you calculate vertex normals you get a smooth sphere (or at least it look's smooth to som extent). because it makes the colors behave like the triangle is a curved surface.

You do this by modifing the vertex normals to average between the triangles that use that vertex.

Mikael

Good example. But this not useful for objects like walls, floors(couse of their low count triangles).

6. ## Re: vertex normals

First you should have an ordered structure of your geometric data. I used half-edge data-structure: www.flipcode.com/tutorials/tut_halfedge.shtml

After that just loop around each vertex, add all the normals of the adjacent polygons and then normalize it.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•