Rotate JMEDesktopState

I would like to make a StandardGame version of TestJMEDesktop and am starting with the code from jmetest.awt.swingui.TestJMEDesktopState. The only thing that I have added is a button which should rotate the entire jmedesktop about 30 degrees…



           // Add a Rotate button
            JButton rotate = new JButton("Rotate" );
              desktopState.getDesktop().getJDesktop().add(rotate);
              rotate.setLocation(200, 0);
              rotate.setSize(rotate.getPreferredSize());
              rotate.addActionListener(new ActionListener() {
               public void actionPerformed(ActionEvent e) {
                  //translate works, but rotate does not
                  //desktopState.getGUINode().getLocalTranslation().addLocal(10f, 0f, 0f);
                  desktopState.getGUINode().getLocalRotation().fromAngleAxis(0.5f, new Vector3f(0,1,0));
               }
              });



I have added this button right after the "quit" button and it shows up correctly...



However, when I click on the button, instead of rotating, I get this...



Do I have to refresh something or are my camera settings wrong?

The quad is in ortho queue - effectively you cannot rotate about y-axis there (it shows only the parts where z==0). Move it out of the queue (QUEUE_SKIP) or to transparent queue (if it's transparent).

when I do that everything disappears…


desktopState.getGUINode().setRenderQueueMode(Renderer.QUEUE_TRANSPARENT);

move it into the view :slight_smile:

Ah, thank you! I kept going back to changing the Queue Mode and it never worked. Silly.