#### Archived

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

# Normals

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

## Recommended Posts

What is a normalized vector, why are they used? When the direction for the normal is entered, should the position be relative to the 0, 0, 0 co-ordinate, or does it work in some completly different way? And umm.... do I have to know anything else to get those normals working?

##### Share on other sites
Vectors are a direction, not a coordinate - so they are always relative to 0,0,0. Normalised vectors are a vector divided by its length - ie. the normalised vector has a length of 1. Use pythagoras to do this. For example, if you have a 2d vector vy,vx to get the length you have to do this: l = sqrt((vy*vy)+(vx*vx)). To normalise the vector, you just do: vx/=l; vy/=l;

Hope this helps!

##### Share on other sites
code snippet.

  D3DXVECTOR3 normal; D3DXVECTOR3 polyvecs[3]; // to normalise D3DXVECTOR3 vec1,vec2; vec1 = polyvecs[1] - polyvecs[0]; vec2 = polyvecs[2] - polyvecs[0]; // cant remember the actual function, // its just a simple cross product. D3DCrossProduct(normal,vec1,vec2); // normalise in the sense to remove anomolies. Normalise(normal);

{ Stating the obvious never helped any situation !! }

1. 1
2. 2
3. 3
4. 4
frob
15
5. 5

• 16
• 12
• 20
• 12
• 13
• ### Forum Statistics

• Total Topics
632155
• Total Posts
3004473

×