Hello!
I´m new here and I hope y can find an answer for my cuestion here…
I want to rotate an object with my mouse. I use de Trackball Simulation.
My problem is that y want to make an absolute rotation that contains all my rotations that I´ve done since open the document.
Here is the source code which I´m using now:
glPushMatrix();
if (preview ) //preview is "TRUE" if you´re moving the mouse (left button pressed)
glRotatef(angle, xr, yr, zr);
readpointer = first;
while (readpointer != NULL)
{
glRotatef(readpointer-> angle, readpointer->xr, readpointer->yr, readpointer->zr);
readpointer = readpointer->next;
}
glCallList(object);
glPopMatrix();
I have to use a list of all rotations that I´ve done since I opened the document. Bevore calling the object (with my object list) y do all these rotations. But that costs many time. That´s why I need another solution.
Here is one of my solutions that doesn´t work very well:
glPushMatrix();
if (preview)
glRotatef(angle, xr, yr, zr);
else
Rotate(angle, xr, yr, zr);
glMultMatrixf(m);
glCallList(object);
glPopMatrix();
I use MY function Rotate() to manipulate the ModelViewMatrix but that doesn´t work very well.
Thank you all… and greetings from Germany