Original Post
Ok, new to OpenGL and all the math that goes along with it and have a quick question. OpenGL has a function called glRotatef(a,x,y,z) which if I understand correctly rotates the projection around the vector x,y,z by angle a. My question is, if I have 2 or more glRotatef() functions, what math would be needed to combine those into a single equivalent function? So for example say I have this code:
a1=5f;
x1=1.0f;
y1=0.5f;
z1=0.25f;
a2=3f;
x2=.75f;
y2=.5f;
z2=.75f;
glRotatef(a1,x1,y1,z1);
glRotatef(a2,x2,y2,z2);
I want to combine into this:
a1=5f;
x1=1.0f;
y1=0.5f;
z1=0.25f;
a2=3f;
x2=.75f;
y2=.5f;
z2=.75f;
// Do some math to calculate a3,x3,y3,z3
glRotatef(a3,x3,y3,z3); // accomplishes some rotation in a single command
What I am looking for is the math needed to calculate a3,x3,y3,z3 in the above example. Thanks!!