title: Rubik's Cube in Java 3D API
body: <p>I'm writing a Rubik's Cube application in Java 3D. I didn't have any problem to draw the cube. The rotation of the cube in the universe function too.</p>
  
  <p>Now I will rotate the different faces. This function as long as I rotate only one face. But when I will make multiple rotation. For example the front face and the right face then the programm choce the wrong stones of the Cube.</p>
  
  <h3>Structure of the Cube</h3>
  
  <p>In the Content Branch Graph I have a 3-dimentional Array of Transform Groups into this Transform Groups I have a 3-dimentional Array of Stones. The Stone-class I have create on myself. It draws a square wiht a Quad Array.</p>
  
  <p>At the moment I select the stones based on the array of the Transform Group. Afer the rotation I reorder the Transform Group into the array.</p>
  
  <p>Here is what I've done so far :</p>
  
  <pre><code>void rotateWhiteFace()
  {
      Transform3D rotate = new Transform3D();
      rotate.rotZ(Math.toRadians(angel2));
      for (int x = 0; x &lt; stoneTransform.length; x++)
          for (int y = 0; y &lt; stoneTransform.length; y++) {
              stoneTransform[x][y][2].setTransform(rotate);
          }
      angel2 = angel2 + 90;
  }
  </code></pre>
  
  <p>Do you have a answer how I could make multiple rotations?</p>