Hi,
I’ve made a 3D world, and in order to view that world from the right position and angle, I use the following:
gl.glLoadIdentity();
Matrix lookAt = Matrix.lookAt(direction,up);
gl.glMultMatrixd(lookAt.columnMajor(),0);
gl.glTranslated(-position.x,-position.y,-position.z);
Which works perfectly well.
However, it seems to me that this appears to be the wrong way around, and that I should really be translating the world so that the viewing position is at the origin, and then rotating the world in the correct direction, ie. translation and then rotation, instead of rotation then translation.
I’m sure I’m just missing something really obvious, but can anyone explain what’s going on?
Cheers,
Chris.