How to get a point to the left/right of a vector - Game Development Stack Exchange most recent 30 from gamedev.stackexchange.com 2020-01-18T19:41:00Z https://gamedev.stackexchange.com/feeds/question/40196 https://creativecommons.org/licenses/by-sa/4.0/rdf https://gamedev.stackexchange.com/q/40196 1 How to get a point to the left/right of a vector MulletDevil https://gamedev.stackexchange.com/users/8312 2012-10-18T07:52:34Z 2012-10-18T09:45:26Z <p>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.</p> <p><img src="https://i.stack.imgur.com/3eBax.jpg" alt="Image showing what I want to achieve"></p> <p>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.</p> <p>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?</p> <p>Edit: I also know the original direction vector.</p> https://gamedev.stackexchange.com/questions/40196/-/40200#40200 12 Answer by Ken for How to get a point to the left/right of a vector Ken https://gamedev.stackexchange.com/users/4568 2012-10-18T08:19:01Z 2012-10-18T09:45:26Z <p>Given only a point and a direction there is no defined 'right' or 'left'. </p> <p>Imagine being a falling raindrop, which direction is right or left for you in that case? </p> <p>In order to calculate (or even define) a right or left you need two directions, typically forward and up.</p> <p>You seem to already have a forward direction, so you need to define a up direction.</p> <pre><code>right_dir=forward X up (cross product) left_dir=-right </code></pre> <p>As you want unit vectors in these direction, you should of course normalize right &amp; left.</p>