Get direction vector from an angle?

This seems like it should be easy but I'm having problems with it. I need to retrieve a vector (the pointing direction) from an angle around a given axis. I can retrieve the quaternion using fromAngleAxis, but then how do I get the vector? Or just get the vector directly from the angle and axis?



Quaternion quat = new Quaternion();
quat.fromAngleAxis( FastMath.PI * angle / 180 , new Vector3f(0,1,0) );



Thanks!

that should do it:


Vector3f direction = quaternion.getRotationColumn(2);

Thank you. Would that same column always yield the direction, or is it dependent upon which axis you're rotating around?



Thanks!

As long as you use Y-Up i think it will always give you the heading / direction.

Remember that quaternions are not absolute "directions"in a space. They are relative rotations, so you will always need the reference (Y-up or similar).