#### Archived

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

# Normals

This topic is 6230 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
Rutin
73
2. 2
3. 3
4. 4
5. 5

• 21
• 10
• 33
• 20
• 9
• ### Forum Statistics

• Total Topics
633426
• Total Posts
3011816
• ### Who's Online (See full list)

There are no registered users currently online

×