I'm having a "5am problem" with my code. My program has to display a 3d model and I need to rotate using the arcball method so far everything i calculated was ok ( i believe...) what I want to happen next is that every time i drag the curser ( which created the vectors) the model will keep rotating from where it is.
I tried using the getFloatv and mult it but was with no success the model keeps returning to its starting point of view . Note : I've used push and pop matrix command in every function so no mess will be done you could say the real question is how to use this quatrainon and matrix multiply to add rotations to one another so is there anything missing? or anything missplaced?
thanks,
EDIT :::::::::::::::: updated code:
Hey, thanks for answering but i still have a problem i tried using an if statement to only multmatrix when the rotation is done but then there is no continuous rotation, it just jumps to the beginning every time
glGetFloatv(GL_MODELVIEW_MATRIX,_oldRotationsQuatro);
glTranslatef(0.f,0.f,DRAWFARONZAXIS);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW); // Modeling transformation
glLoadIdentity();
glColor3d(1,1,1);
drawObject(model);
glRotated(model->getCurrRotatingAngle(),model->getRotatingAroundVector().getX(),
model->getRotatingAroundVector().getY(),
model->getRotatingAroundVector().getZ());
// if (end rotate)
glMultMatrixf(_oldRotationsQuatro);
drawCamera();
glPopMatrix();
good rotation but super speed...
EDIT Thanks i figured something out. the glmultmatrix doesnt work exactly as i thought so i just added another matrix and used some old savings.
thanks!