Sign in to follow this  

D3D - Vertex Normals

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
[google]
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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.

Share this post


Link to post
Share on other sites

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

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this