   Vector rotation troubles
  Please excuse my crude diagram! :)Basically what I have is four points (in 3D space), which are coupled together (blue and green dots).What I want to find is the difference in height between the two couples (i.e the average height of the blue dots as compared to the green ones). However, this vector needs to lie along the red vector - in other words I need to find the purple vector. If the red vector (which is actually the forward component of a creature's orientation) remained level like in the diagram it would basically be a 2D problem (the Z component of the vector between blue and green would give me the vector I'm after). But the red vector will be at an arbitrary angle, which is where I get confused. It looks like a simple projection to me, although I can't figure out how to do it!   
  Scale the (normalised) red vector (nvR say) by the dot product between itself and the blue to green vector (vBG say).So the answer isvProj = nvR * ( vBG . nvR )EDIT: You can see that this is true using trig. The length of the projected vector is (length vBG)cos(theta), so you need to scale a normalised vector in the direction of the red vector by that amount.Since vBG . nvR = (length vBG)(length nvR)cos(theta) = length(vBG)*1*cos(theta)   ;  Thanks - works perfectly!   