glTranslate and glRotate dont work

Hi all
i follow the example “getting started with jogl” and insert some lines like this

public void init(GLDrawable drawable)
{
    this.gl = drawable.getGL();
    this.glDrawable = drawable;

    drawable.setGL( new DebugGL(drawable.getGL() ));

    System.out.println("Init GL is " + gl.getClass().getName());
    gl.glLoadIdentity();                             // Reset The Projection Matrix
} 
public void display(GLDrawable drawable)
{

          gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT );
          gl.glLoadIdentity();
          gl.glColor3f(1.0f, 0.0f, 0.0f );
          gl.glTranslatef(0,0,1f);  // zoom out

          gl.glBegin( GL.GL_TRIANGLES );
                gl.glColor3f(0.5f,0.7f,0.8f);
              gl.glVertex3f( 0.0f, 0.0f, 0.0f );
              gl.glColor3f(1.5f,1.7f,1.8f);
              gl.glVertex3f( 0.5f, 0.0f, 0.0f );
              gl.glColor3f(0.7f,0.3f,0.2f);
              gl.glVertex3f( 0.5f, 0.5f, 0.0f );
          gl.glEnd();
} 

the glTranslate has no effect
the example from here is to big to show many objects
only the triangle i can show on the screen

can anybody tell me what i made false ?
i cannot found an simple introduction into jogl
anybody knwos a good source on the web ?

Thanks

My Question is … who i can distance the cam from the object ?
in gl4java i used glTranslate
also the glRotate method dont work
glRotate can rotate the arena on 3 axis (x,y,z )

thanks for help

glRotate and glTranslate work for sure. Please read some of the tutorials on http://nehe.gamedev.net, since you seem to have some misunderstanding of these calls. glTranslate(0,0,1f) does not “zoom out”, it does the opposite. These calls don’t manipulate the camara-position. they rather move a “drawing cursor” through 3D space.

Also does glRotate not rotate around the x, y or z axis, it rotates an arbitrary angle around a vector specified by x,y and z components.

Maybe you have an error in your matrix mode setting, since your code contains the line:


gl.glLoadIdentity();         // Reset The Projection Matrix 

glLoadIdentity does only reset the projection matrix, if the matrix mode is set to GL_PROJECTION, but I don’t see a glMatrixMode()-call in your code. If you have switched to GL_PROJECTION somewhere in your code, then maybe you have forgotten to switch back to GL_MODELVIEW before drawing anything. If so, the glTranslate and glRotate calls might modify the wrong matrix.

See The OpenGL SuperBible (http://herakles.zcu.cz/local/manuals/OpenGL%5FSuperBible) for more Information on GL.