PDA

View Full Version : matrices rotations



05-17-2004, 03:28 AM
im just learning to do rotations with matrices. At this point i prefer not to the higherlevel glrot commands.

If i load amodel i want to provide an autorotate function, so the user can activate an automated rotation across x,y,z or all these 3axis at once.

should i make 3 seperate matrices, one for each axis then multiply them together, then pass to the glmultimatrix function, or is there a way to make the required matrix that accounts for all rotations in 1 matrix ?

Also can anyone suggest an algorithm that would exhibit the model in a realy nice rotational way so that it systematicly rotates to every side and angle of the model

thanks for any help

ZbuffeR
05-17-2004, 12:03 PM
I think 3 axes for rotation is overkill in your case. You only want to present all the parts of the model, not to make the use sea-sick, right ?

I suggest 1 main rotation around vertical axis combined with 1 slower 'ping-pong' rotation around one horizontal axis (from -85 to 85 degrees).

Just use multmatrix if glrotate does not suits your need (BTW, why ?). And don't forget to send first the 'pingpong' rotation, as matrix multiplications reverse the intuitive order.

05-18-2004, 12:56 AM
i figured with all the time i put in to learn matrices i should stick to it, but it works with glrot either way.

I tried this ping pong technique you suggested, and it worked, but i didnt realy like the way it displayed the model.

Ill just have to experiment, to see if i can find a general techiniue that looks pleaseing to the eye

thanks