# Direction of vectors and normals?

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

## Recommended Posts

Hi guys,

Trying to calculate the normal, which I have the equation for, but the thing is I don't understand how a Vector in 3D space knows which direction it is pointing to? Because I thought a vector is just a point in space, so how can we determine which way a vector is facing as I need it for calculating Normals to do all the lighting effects and so on?

Thanks

##### Share on other sites
When we talk about the direction of a vector we usually mean the direction that points from the origin (0,0,0) to the position the vector denotes. So if the y direction is "up" then (0,1,0) is a vector that is pointing up.

##### Share on other sites
In simple words first: A vector is the direction thingy, not the point.

We call a set of things a vector space if we can add them, subtract them and scale them, and these operations satisfy some reasonable properties. The set of points in 3D space are not a vector space, and you shouldn't think of them as vectors. The translations in 3D space (e.g., move 1 unit up) can be added, subtracted and scaled, all the right properties are satisfied and they are therefore vectors.

You can pick a particular point in 3D space, call it the origin and then you can refer to a point by the vector that has to be applied to the origin to get to the point.

This is the way I think about these things, and it makes things very clear. For further reading: http://en.wikipedia....ki/Affine_space

##### Share on other sites
To expand on what japro said, a "vector" is simply 3 numbers. When that vector is used as a point, the numbers represent the offset on each of the 3 axes from (0,0,0). When it is used as a normal, the numbers represent a direction from (0,0,0).

Vectors are additionally stored with a 4th component, w. For a point, w = 1. When you multiply a point vector by a translation matrix, that point is translated. For a normal, w = 0. When you multiply a normal vector by a translation matrix, it is not translated (because the translation is multiplied by w).

##### Share on other sites
The mathematician in me feels uncomfortable with the fuzzy language that others are using. On the other hand, it's probably good enough for game development and I probably should refrain from trying to argue with everybody about things that ultimately won't make much difference in your code.

I should find some pills to take when this happens.

##### Share on other sites

The mathematician in me feels uncomfortable with the fuzzy language that others are using. On the other hand, it's probably good enough for game development and I probably should refrain from trying to argue with everybody about things that ultimately won't make much difference in your code.

I should find some pills to take when this happens.

I know how you feel, unfortunately I have way to much experience getting blank stares when I explain things "technically" correctly (the only real kind of correct )

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 11
• 15
• 21
• 26
• 11