Public Group

# D3D - Vertex Normals

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

## Recommended Posts

Hello, can someone explain to me in english what a vertex normal is? They seem like quite a useless hassle to deal with. First of all, what is it supposed to represent? I know it "points" to a direction... but what's so particularly special about where it points? Where should it point? Also, you tell Direct3D where a vertex normal points using three floats. Do these floats represent a point in space, or..? And, if it is a point, does it matter how far away it is from the original shape? Thanks in advance for any explanations on this!

##### Share on other sites
Well alright, vertex normals for beginners:
A normal is just a vector, so its represented by several floats/doubles, typically 2 for 2d, or 3 for 3d - x, y & z. You can imagine a vector as the line from the origin to the point, which gives a direction. The length of a vector is the lenght of this line, remember your pythagarous to calculate that. Normals are almost always taken to be unit length (ie, a length of 1) which gives them lots of handy properties.

A triangle normal is the vector that protrudes directly outwards (perpendicular) to the face. Remember that its only a direction really, so its relative to the actual triangle - shift the triangle around and the normals stay the same. Vertex normals are somewhat of a hack, but they basically represent the avaraged normals of all the polygons that the vertex is part of.

Normals get used for lots of things, in D3D they'll primarily be used for lighting, but you can get lots of useful information for collision and other effects from them.

##### Share on other sites
I tried google, same old "I'll assume you know this, so I'll start from that" guides.

Just seems like something Direct3D should be able to handle for you :)

##### Share on other sites
Another question:

How does D3D interpret the vertex normal? You tell D3D your vertex normals through three floats - do these three floats represent a point? What do they represent and how?

##### Share on other sites
The polygons we use for describing a surface are only an approximation of a much smoother surface. Say that of a sphere.

The vertex normals are the normals to that smoother surface at the particular vertex. The values make up a vector that is a direction from the vertex. If you want to visualise normals you can draw the model as usual and then draw a line from the vertex to vertex+vertexnormal. If you want to think of the vertex normals end point in world/model space it's located at vertex+normal.

Hope that makes some sense.

1. 1
2. 2
Rutin
21
3. 3
A4L
15
4. 4
5. 5
khawk
14

• 13
• 26
• 10
• 11
• 44
• ### Forum Statistics

• Total Topics
633742
• Total Posts
3013639
×