I am working on a 3D graphic editor (like TrueSpace, only far more simple).
I have a 3D grid, who can be rotated and translated, these transformations affecting also the objects in the scene.
Now, my problem is that when I select one object to translate him to my right, the object is translated to the right of the grid. So if the grid is rotated 90 degrees on right after Y axe, the object will actualy move away, further from me.
That’s not really the type of navigation I would like to have for my application
This is what I’m using right now:
DrawObject()
{
glLoadIdentity();
gluLookAt(…);
glTranslatef(m_grid.x, m_grid.y, m_grid.z);
glRotatef(m_grid.rotx, 1, 0, 0);
glRotatef(m_grid.roty, 0, 1, 0);
glRotatef(m_grid.rotz, 0, 0, 1);
glTranslatef(pObj->x, pObj->y, pObj->z);
glRotatef(pObj->rotx, 1, 0, 0);
glRotatef(pObj->roty, 0, 1, 0);
glRotatef(pObj->rotz, 0, 0, 1);
glBegin();
theObject;
glEnd();
}