Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a position vector of a point in space and a quaternion for it's rotation. What i'm trying to calculate is a point too the left and a point to the right.

Image showing what I want to achieve

I have the position and rotation(quaternion) of the red dot. What I want is to get the position of the green dots. I have a float value for the distance I want these points to be.

With only the position and rotation is it possible to get a unit direction vector pointing left/right which I can multiply by my float value?

Edit: I also know the original direction vector.

share|improve this question
Do you have the Direction vector and any fixed Vector (like UP)? – 0xBADF00D Oct 18 '12 at 8:14
I have the original direction vector. (edited question) – MulletDevil Oct 18 '12 at 8:44
up vote 9 down vote accepted

Given only a point and a direction there is no defined 'right' or 'left'.

Imagine being a falling raindrop, which direction is right or left for you in that case?

In order to calculate (or even define) a right or left you need two directions, typically forward and up.

You seem to already have a forward direction, so you need to define a up direction.

right_dir=forward X up  (cross product)

As you want unit vectors in these direction, you should of course normalize right & left.

share|improve this answer
I know the up direction. I also realized I know the first direction it's facing. Can I use my rotation and the vector to calculate the new forward vector and then do as you have suggested? If I can get the angle I can use the dot product with the original direction to get the new direction I think. – MulletDevil Oct 18 '12 at 8:44
I assume all this is in 3D. If you have a quaternion, you can apply that to both the original forward direction and original up direction, to give you a new forward and new up. Get the cross product of the two new vectors. – Ken Oct 18 '12 at 8:47
Excellent, thank you. I'll give it a go and mark it as the answer if it works. – MulletDevil Oct 18 '12 at 8:56
+1 for "Imagine being a falling raindrop" for both illustrating the point and being sort of poetic. – michael.bartnett Oct 18 '12 at 9:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.