I am not saying this works but it is not how I want it to work. If any one that knows what I am doing wrong or can help me out please e-mail me or respond to this post
Thanks
David Gholami
you have to think of a sphere.
so, i will give you the math, you will write the code:
x = sin(angle_one_in_radians)
*cos(angle_two_in_radians)
z = cos(angle_one_in_radians)
*cos(angle_two_in_radians)
y = cos(angle_one_in_redians)
*sin(angle_two_in_radians)
where angle_one is the angle starting looking down the z-axis and rotating around the y-axis, and angle_two is rotating around the x-axis.
this i called the equation for a sphere, pretty standard stuff, this gets the unit change, you can multiply x and z by any scalar to increase the step amount.
I’m not sure what the axis = pos.Normalize()means. Normally I would expect something like
glRotatef(angleX, 1.0f, 0.0f, 0.0f);
glRotatef(angleY, 0.0f, 1.0f, 0.0f);
for the x- and y-axis (or maybe in the other order, first yaw then pitch?)
Don’t forget to start with the same matrix all the time, so add glLoadIdentity() before or glPushMatrix(); glPopMatrix() around the transformations. Otherwise the rotations and transformations will concatenate at each loop (far out…).