samedi 9 juillet 2016

How to add multipile objects in java opengl?

I am trying to create a room with some objects in it, using jogl. When I add one objects everything is fine, but when I try to add more than one objects, everything is wrong, and is not as I want it to be. Here is the code: (The part that supposed to create the objects)

 axeTexture.bind(gl);
    gl.glScalef(0.75f, 0.75f, 0.75f);
    gl.glTranslatef(0.095f, 0.01f, -0.02f);
    axe.drawModel(gl);
    gl.glEnd();


    chairTexture.bind(gl);
    gl.glScalef(0.75f, 0.75f, 0.75f);
    gl.glTranslatef(12.5f, 0.0f,0.9f);
    gl.glRotatef(-90f, 0f, 100f, 0f);
    chair.drawModel(gl);
    gl.glEnd();

As you can see on the picture the axe looks really weird, and the couch isn't at its place, I wanted it to be next to the wall

Thank you!

Aucun commentaire:

Enregistrer un commentaire