I have no background in Math nor any plans on becoming any good in it.
I've been slowly but surely making my way through writing some bits of code that involve NPC pathing in a video game. I'm stuck at one particular spot that I'm sure is easy peasy for anyone with even a basic understanding of geometry. Incredibly challenging for someone who hasn't done any geometry since junior high.
I have a plane P which is defined by its normal vector {x, y, z}
I need to find a vector V that will move in the X, Y direction I need, but stay parallel to the plane P. X and Y can change but must remain proportional to each other, so the general direction of the vector is the same when ignoring the Z axis (looking from above...), but parallel to the plane P.
Not sure I'm being clear.
Rephrasing:
I have an object that I need to make slide in a particular X, Y direction in a 3D world, but it must slide parallel to the plane P that happens to be the ground, of which I know the normal vector. I need to find the X, Y, Z vector for the object that will make sure it never intersects with the plane P.
I've tried googling around, playing around with different things such as the dot product and whatnot. Thought I'd just ask you guys.
Thanks in advance!
Let $(x,y,z)$ be the normal vector of the plane. Then a vector $(X,Y,Z)$ is parallel to the plane if and only if $$xX+yY+zZ=0.$$