From: Lars Beyer-O. <lar...@hi...> - 2002-01-31 13:51:27
|
First posting. I'm really new at this, so I hope this question is not to simple. What I want to do is to draw a wired cube consisting of glutSolidCubes, and rotate the cube like it was one object. This is the code for drawing the one of the six sides of the cube. //Left-side gl.glLoadIdentity(); gl.glTranslatef(-1.0f, 2.0f, -20.0f); gl.glRotatef(90.0f, 0.0f, 0.0f, 1.0f); gl.glScalef(6.0f, 0.5f, 0.6f); glut.glutSolidCube(1.0f); //Lower-side gl.glLoadIdentity(); gl.glTranslatef(1.0f, 0.0f, -20.0f); gl.glScalef(6.0f, 0.5f, 0.6f); glut.glutSolidCube(1.0f); //Right-side gl.glLoadIdentity(); gl.glTranslatef(3.0f, 2.0f, -20.0f); gl.glPushMatrix(); gl.glRotatef(90.0f, 0.0f, 0.0f, 1.0f); gl.glScalef(6.0f, 0.5f, 0.6f); glut.glutSolidCube(1.0f); //Upper-side gl.glLoadIdentity(); gl.glTranslatef(1.0f, 4.0f, -20.0f); gl.glScalef(6.0f, 0.5f, 0.6f); glut.glutSolidCube(1.0); I build the rest of the cube in the same way, just translating the glutSolidCubes around. My problem arises when i want to rotate all the glutSolidCubes as one object. I know how to rotate the glutSolidCubes as individual objects, but I don't get anywhere with that (do I ?). Anyone with a solution? Lars |