but i finally went to code. q3 has this for finding the orth angle
void MakeNormalVectors( const vec3_t forward, vec3_t right, vec3_t up) { float d; // this rotate and negate guarantees a vector // not colinear with the original right[1] = -forward[0]; right[2] = forward[1]; right[0] = forward[2]; d = DotProduct (right, forward); VectorMA (right, -d, forward, right); VectorNormalize (right); CrossProduct (right, forward, up);}
VectorMA stands for VectorMultiply then Add. outputs with ID software are always the last part of the function call.
so vectorMA is multiply right by -d then add forward to it and save it in right.
ok so this function takes forward and gives you right. from there its a dotproduct op for projections.
using the above it would be
MakeNormalVectors(normal,right,junk);scale.x = DotProduct(move,right);scale.y = -DotProduct(move,normal);//notice the negnewmove = scale.x*right;newmove += scale.y*normal;
if that doesnt do it i just dont know... but its exactly the same as the one i gave before sooo.