We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I'm trying to create two quaternions (one for rotation on the x-axis and one for rotation on the y-axis) and then use these to apply it to a PVector(x,y,z).
What I've done so far:
I found a quaternion class on the Processing forum. I can use the fromAxis() function to generate my quaternions, but there's no way to apply it to a PVector. This forum also presents a rotate(PVector v, PVector r, float a) function. When applying this - I'm not receiving my desired results. The way I am calling this function is: rotate( myVec, new PVector( 1, 0, 0 ), myAngle). I'm using the r argument to say that this is the rotation in the x-axis and then I'd call it again for the y-axis (0,1,0). Unfortunately this function isn't working for me and I'm receiving unexpected results.
I also tried the toxiclibs Quaternion object using createFromAxisAngle() to generate my two quaternions. However - I can't seem to find a way to apply this quaternion to a Vec3D...
Is there a better way to go about doing this? Is there a way to apply the quat to a PVector or Vec3D?