Original Post
I have a problem with matrices. I use quaternions to draw a sphere rotation about X-axis and following a line that rotates about Y-axis, like the railgun in quake
But now i want the sphere not to follow the line, i thought using glLoadIdentity() before DrawSphere(), but if i do that, it doesnt draws the sphere. That''s the original code:
CQuaternion qRotationY; qRotationY.CreateFromAxisAngle(0, 1, 0, rotation); qRotationY.CreateMatrix(matrix); glMultMatrixf(matrix); DrawLine(); CQuaternion qSphereRotation; gSphereRotation.CreateFromAxisAngle(1, 0, 0, rotation * 8); qSphereRotation.CreateMatrix(matrix); glMultMatrixf(matrix); DrawSphere(); rotation++It''s a tutorial from gametutorials.com. I hope you can understand and help me :D Thank you