Original Post
Hello everyone,
I need to calculate to be able to calculate a rotation vector from a set of rotation around 3 axes (x,y,z) with z
being up, x being right, y out.
I first came up with this pseudo code:
But when I multiplied these rotation vectors with a point, I, of course, always ended up with (0,0,0).
So I quickly replaced the 0's in the first snipped to 1.0 to preserve the values calculated in the other vectors.
Now this worked for all the individual axes, but when combining them, it'll produce invalid results.
Can someone look at my pseudo-code and tell me what I'm doing wrong?
I need to calculate to be able to calculate a rotation vector from a set of rotation around 3 axes (x,y,z) with z
being up, x being right, y out.
I first came up with this pseudo code:
vec3f getRotationVecX(float radians)
return vec3f(0.0f, cos(radians), sin(radians));
vec3f getRotationVecY(float radians)
return vec3f(cos(radians), 0.0f, sin(radians));
vec3f getRotationVecZ(float radians)
return vec3f(cos(radians), sin(radians), 0.0f);
But when I multiplied these rotation vectors with a point, I, of course, always ended up with (0,0,0).
So I quickly replaced the 0's in the first snipped to 1.0 to preserve the values calculated in the other vectors.
Now this worked for all the individual axes, but when combining them, it'll produce invalid results.
Can someone look at my pseudo-code and tell me what I'm doing wrong?