PDA

View Full Version : lookat() changed the location



omegafox
12-23-2003, 08:57 AM
When I used this function, it changed dot's location to upper-front-right from bottom-back-left. I dont get it. what caused to change its location?

public void glEnlarge()
{
GL.glMatrixMode(GL.GL_PROJECTION);
GL.glLoadIdentity();
Size += 1.0f;
GL.gluPerspective(Size, 1.0f, 1.0f, 100.0f);
GL.glScalef(m_fScaleFactor,m_fScaleFactor,m_fScale Factor);
GL.gluLookAt(0.0f, 0.0f, -2.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);
}

dorbie
12-23-2003, 09:33 AM
You should set the matrix mode to MODELVIEW before calling scale and lookat.

In addition you should call lookat first before you perform the scale or any other transformations unless you have a very good reason and know exactly why you are doing this strange thing.