I have a vector with magnitude of 50.
I have an angle on the x axis of 45, and angle on y axis of 132.
(don’t tell me specifically the answer, give me how you got it)
and I have the coordinate in 3d space(xyz) that I want the vector to go from. So this vector would point out from this coordinate at the given angles and I want the coordinate it ends at.
it should be something like this?
nx=cos()*vectormagnitude
ny=sin()*vectormagnitude
nz=tan()*vectormagnitude
but the way I have it the Y get’s all screwed up, way out of what it should be.
In other words, you want to rotate a point in three dimensions. Then you need to solve this:
v’=ZYXv
where v is the start position of your point (your vector with a magnitiude of 50 at xyz), and X, Y & Z are your matricies to rotate a point laong the X, Y and Z axis respectivly.
the eqns you’ll get if you expand the matricies out have a few more terms than you’d care to poke a stick at =)
that is, if I understood your point correctly…
if you want the rotation matricies, check out the web or the back of the red book. they rotate homogeneous coords; in practice, you probably don’t want to compte the w coordinate.
Uh… actually the code above assumes (perhaps erroneously) that the angle to the x-axis lies in the x-z plane. That is, I assumed that the projection of your vector onto the x-z plane had an angle of THETA with the x-axis.
I’m interested in the answer to this problem. I think this question is similar to the one I posted a few questions ago. (however, he must have asked it much more elegantly, for I haven’t got any replies yet…