hi dj,

> I'm not sure what the best solution is - should I implement a rotateSelf() function which applies a transform about the object's current origin?

you can do that, but one essence of 3d-programming is to learn how to use matrices, to do your desired transformations..

here is how you can do it, you need 3 matrices:

M_30_deg -> 30 degrees rotation around axis z (as if it's sitting at a 30 degree angle (like our planet, kind of)

M_mod -> modulated rotation around axis y (for rotating around its own axis)

now multiply both matrices in this order each frame:

M_current_frame = M_30_deg * M_mod

and multiply that matrix with your object's vertices, that's it .. :)

the rotateSelf()-function would multiply the M_mod-matrix with the object's-vertices first and after that you would multiply the M_30_deg-matrix with the object's vertices.. that works as well, but wouldn't be so nice, since you have a double amount matrix-vertex-multiplications.

rather than the rotateSelf()-function i'd recommend to put a applyMatrix()-function to your object and create the matrix-transform-chain first with matrices and multiply them, to get the final matrix and at the end apply the final matrix to your object ..

ike

> I'm not sure what the best solution is - should I implement a rotateSelf() function which applies a transform about the object's current origin?

you can do that, but one essence of 3d-programming is to learn how to use matrices, to do your desired transformations..

here is how you can do it, you need 3 matrices:

M_30_deg -> 30 degrees rotation around axis z (as if it's sitting at a 30 degree angle (like our planet, kind of)

M_mod -> modulated rotation around axis y (for rotating around its own axis)

now multiply both matrices in this order each frame:

M_current_frame = M_30_deg * M_mod

and multiply that matrix with your object's vertices, that's it .. :)

the rotateSelf()-function would multiply the M_mod-matrix with the object's-vertices first and after that you would multiply the M_30_deg-matrix with the object's vertices.. that works as well, but wouldn't be so nice, since you have a double amount matrix-vertex-multiplicati

rather than the rotateSelf()-function i'd recommend to put a applyMatrix()-function to your object and create the matrix-transform-chain first with matrices and multiply them, to get the final matrix and at the end apply the final matrix to your object ..

ike