Hi.
I have tried to do some scene lately where I want to rotate my object around it self and after that translate it to an arbitrary point in space. After that I want to use gluLookAt… But when I do this I get my object to rotate around itself but then after the gluLookAt it continue to rotate but now in reference to its new point in space. How do I solve this?
Here is my code:
glLoadIdentity();
gluLookAt(-wld->cam->posx,-wld->cam->posy,-wld->cam->posz,wld->cam->lx,wld->cam->ly,wld->cam->lz,0,1,0);
glRotatef(obj->xv, 1.0f, 0.0f, 0.0f);
glRotatef(obj->zv, 0.0f, 1.0f, 0.0f);
glRotatef(obj->yv, 0.0f, 0.0f, 1.0f);
glTranslatef(float(obj->xp),float(obj->yp),float(obj->zp));
I have tried to put the gluLookAt after the rotations and the translations but then it disappears from the screen.
What am I doing wrong?
/Dew