Hello everybody
I’m a beginner at jogl and i have a really weird problem with the gluLookAt() fonction.
Here is my code:
public void init(GLDrawable gld) {
GL gl = gld.getGL();
GLU glu = gld.getGLU();
gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
gl.glViewport(0,0,500,300);
gl.glMatrixMode(GL.GL_PROJECTION);
gl.glLoadIdentity();
glu.gluLookAt(0.0, 0.0, 0.0, 0.0, 0.0, -100.0, 0.0, 1.0, 0.0);
glu.gluPerspective(45.0f, 800.0f / 600.0f, 1.0f, 500.0f);
gl.glMatrixMode(GL.GL_MODELVIEW);
}
public void display(GLDrawable gld) {
GL gl = gld.getGL();
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
gl.glLoadIdentity();
gl.glTranslatef(0.0f,0.0f,-5.0f);
gl.glBegin(GL.GL_TRIANGLES);
gl.glVertex3f( 0.0f, 1.5f, 0.0f);
gl.glVertex3f(-1.0f, -1.0f, 0.0f);
gl.glVertex3f( 1.0f, -1.0f, 0.0f);
gl.glEnd();
}
That works fine and i see a beautifull white triangle.
But now if I change the value of glu.gluLookAt from (0.0, 0.0, 0.0, 0.0, 0.0, -100.0, 0.0, 1.0, 0.0) to (0.0, 0.0, 2.0, 0.0, 0.0, -100.0, 0.0, 1.0, 0.0), my triangle disappear and I don’t understand why!!
So if someone could help me, that would be great!!
BTW sorry for my poor english
Thanks guys