Possible to express two glRotate in one glRotate?

Possible to express two glRotate in one glRotate?

Post by Byungsung C » Wed, 17 Mar 1999 04:00:00



I wonder if it is possible to express two glRotate in one glRotate?

I am working on a program that the curretn rotation angle and axis are
displayed as a user rotate an object in any direction.
I am using glRotatef( angle, x, y, z) to rotate an object.
But if an object is rotated more than once in any random direction,
how can I calculate the angle and axis values?

For example, a user rotate an object 90 deg. about x axis and then
rotate 90 deg. about z. axis, is it possible to express these two
rotations in a single glRotate function?

Thanks in advance,

Byungsung Cho

 
 
 

Possible to express two glRotate in one glRotate?

Post by Philippe Gue » Wed, 17 Mar 1999 04:00:00


I think you need to implement quaternions.

A quaternion expresses a rotation, and subsequent rotations
are handled as quaternions combinations. Then from the resulting
quaternion, you get the resulting rotation (axis + angle), that
you give to glRotate...


> I wonder if it is possible to express two glRotate in one glRotate?

> I am working on a program that the curretn rotation angle and axis are
> displayed as a user rotate an object in any direction.
> I am using glRotatef( angle, x, y, z) to rotate an object.
> But if an object is rotated more than once in any random direction,
> how can I calculate the angle and axis values?

> For example, a user rotate an object 90 deg. about x axis and then
> rotate 90 deg. about z. axis, is it possible to express these two
> rotations in a single glRotate function?

> Thanks in advance,

> Byungsung Cho



 
 
 

1. 3 glRotate in ONE

Hi,
is there a way to make 3 rotations with 1 glRotate ?
Each rotation is about one axis (x, y, z).
Example:
    glRotatef(degree1, 1.0, 0.0, 0.0)
    glRotatef(degree2, 0.0, 1.0, 0.0)
    glRotatef(degree3, 0.0, 0.0, 1.0)

    I need to obtain the effect of these 3 instructions
    with just one glRotate. Is it possible ?
Thanks.

2. Trade A2000/VT 2.0 for PC LW 5.1...

3. glRotate

4. Window Icons

5. Rolling balls using glRotate

6. how to identify clockwise polygon winding

7. glRotated won't rotate

8. New applescript tutorial

9. Newbie glRotate Question

10. MatrixMult vs. glRotate

11. glRotate az,el

12. glRotate

13. glRotate with radians