Problem with: glutSolidSphere & GL_QUADS

Hi,
for my battle system im using a Cubemap to fake a full 3D world.
Im using 6 textures, 4 for sides and 2 for ground and sky.
Now i would like to use GL_QUADS to display my 2D battlers.
The problem now is: My Battlers arent display =/
Heres the code/setting im using:
settings:

        gl.glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
        gl.glShadeModel(GL.GL_FLAT);
        gl.glEnable(GL.GL_TEXTURE_2D);
        gl.glEnable(GL.GL_BLEND);
        gl.glColorMask(true, true, true, true);
        double widht = 774;
        double height = 540;
        final float h = (float) width / (float) height;
        gl.glMatrixMode(GL.GL_PROJECTION);
        gl.glLoadIdentity();
        glu.gluPerspective(60.0f, h, .1, 10);
        gl.glViewport(0, 0, (int)width, (int)height);
        gl.glMatrixMode(GL.GL_MODELVIEW);
        gl.glLoadIdentity();

render:

  public void render(GL gl){
    renderBG(gl);
    for(int i=0;i<battler.length;i++){ // 2 Battlers
      Texture tex = battler[i].battler.animations[battler[i].action].getFrame(); // The Texture is a texture with content.
      tex.bind();
      tex.enable();
      gl.glTranslatef(battler[i].coor.xf, battler[i].coor.yf, battler[i].coor.zf); // All Coor are zero.
      TextureCoords coords = tex.getImageTexCoords();
      gl.glBegin(GL.GL_QUADS);
        gl.glTexCoord2f(coords.left(), coords.bottom());
        gl.glVertex3f(0, 0, 0);
        gl.glTexCoord2f(coords.right(), coords.bottom());
        gl.glVertex3f(1, 0, 0);
        gl.glTexCoord2f(coords.right(), coords.top());
        gl.glVertex3f(1, 1, 0);
        gl.glTexCoord2f(coords.left(), coords.top());
        gl.glVertex3f(0, 1, 0);
      gl.glEnd();
      gl.glTranslatef(-battler[i].coor.xf, -battler[i].coor.yf, -battler[i].coor.zf);
    }
  }
  private void useCamera(GL gl){
    gl.glRotatef((float)Math.toDegrees(Camera.v),1f,0f,0f); // is zero.
    gl.glRotatef((float)Math.toDegrees(Camera.h),0f,1f,0f); // is zero.
    gl.glRotatef((float)Math.toDegrees(Camera.c),0f,0f,1f); // is zero.
  }
  private void renderBG(GL gl){
    cubemap.bind();
    cubemap.enable();
    gl.glEnable(GL.GL_LIGHTING);
    gl.glTexGeni(GL.GL_S, GL.GL_TEXTURE_GEN_MODE, GL.GL_NORMAL_MAP);
    gl.glTexGeni(GL.GL_T, GL.GL_TEXTURE_GEN_MODE, GL.GL_NORMAL_MAP);
    gl.glTexGeni(GL.GL_R, GL.GL_TEXTURE_GEN_MODE, GL.GL_NORMAL_MAP);
    gl.glEnable(GL.GL_TEXTURE_GEN_S);
    gl.glEnable(GL.GL_TEXTURE_GEN_T);
    gl.glEnable(GL.GL_TEXTURE_GEN_R);
    gl.glTexEnvi(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_REPLACE);
    gl.glMatrixMode(GL.GL_TEXTURE);
    gl.glPushMatrix();
    gl.glLoadIdentity();
    useCamera(gl);
    glut.glutSolidSphere(5.0, 40, 20);
    gl.glDisable(GL.GL_LIGHTING);
    gl.glPopMatrix();
    gl.glMatrixMode(GL.GL_MODELVIEW);
    gl.glDisable(GL.GL_TEXTURE_GEN_S);
    gl.glDisable(GL.GL_TEXTURE_GEN_T);
    gl.glDisable(GL.GL_TEXTURE_GEN_R);
  }

Hi!

Have you ever succeeded in displaying your fighters before using quads?

Yes, in ortho mode they was displayed, before in 3D Mode also, but now its not possible anymore and i dont get it why i cant display them anymore =/
OK! now my system is displaying the Quad, i made a mistake with Z, i used + instead of - and i forgot to use: cubemap.disable();
Thx, can be closed :slight_smile:

Please can you post the both pieces of code with your corrections? It would allow me to see exactly what you did to make it work.

The upper part i didnt change.
I juz realized that i used .1 to 10 for range.
So i changed the Z Coor of my Battler to -6f and there he was :3
In the next step i saw that my battler has a polygon, but no texture.
I searched for the reason and i saw the line: cubemap.enable();
so i completet it @ the end of my background rendering by: cubemap.disable();
Here are my modifications:

  private void renderBG(GL gl){
    gl.glLoadIdentity();
    cubemap.bind();
    // -------------------------------------- WHERES THE REST? :(
    cubemap.enable();
    // -------------------------------------------------------------------
    gl.glEnable(GL.GL_LIGHTING);

    gl.glTexGeni(GL.GL_S, GL.GL_TEXTURE_GEN_MODE, GL.GL_NORMAL_MAP);
    gl.glTexGeni(GL.GL_T, GL.GL_TEXTURE_GEN_MODE, GL.GL_NORMAL_MAP);
    gl.glTexGeni(GL.GL_R, GL.GL_TEXTURE_GEN_MODE, GL.GL_NORMAL_MAP);

    gl.glEnable(GL.GL_TEXTURE_GEN_S);
    gl.glEnable(GL.GL_TEXTURE_GEN_T);
    gl.glEnable(GL.GL_TEXTURE_GEN_R);

    gl.glTexEnvi(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_REPLACE);

    gl.glMatrixMode(GL.GL_TEXTURE);
    gl.glPushMatrix();
    gl.glLoadIdentity();

    useCamera(gl);

    glut.glutSolidSphere(5.0, 40, 20);

    gl.glDisable(GL.GL_LIGHTING);

    gl.glPopMatrix();
    gl.glMatrixMode(GL.GL_MODELVIEW);

    gl.glDisable(GL.GL_TEXTURE_GEN_S);
    gl.glDisable(GL.GL_TEXTURE_GEN_T);
    gl.glDisable(GL.GL_TEXTURE_GEN_R);
    // ------------------------------------------------- HERE IT IS :3
    cubemap.disable();
    // -------------------------------------------------------------------
  }