Graphic problems with own game class

Hello community!



I just explored JMonkeyEngine 2 days ago. I already worked through most of the "Learning jME" tutorials, as well as the user's guide.

So now i wanted to build my own game class from FixedLogicrateGame.



The code is as follows:

/**
 *
 */
package spacemonkey;

import com.jme.app.*;
import com.jme.scene.shape.*;
import com.jme.scene.*;
import com.jme.renderer.*;
import com.jme.bounding.*;
import com.jme.input.*;
import com.jme.math.*;
import com.jme.image.*;
import com.jme.scene.state.*;
import com.jme.system.*;
import com.jme.util.*;
import com.jme.light.*;
import java.net.*;

/**
 * @author Javawork
 *
 */
public class Main extends FixedLogicrateGame {
   
   private Node          root;
   private Camera          cam;
   
   protected Texture getTextureFromFile(String filename) {
      
      try
      {         
         URL url = new URL("file:"+filename);
         
         return TextureManager.loadTexture(url, Texture.MM_LINEAR, Texture.FM_LINEAR);
      }
      catch(MalformedURLException e)
      {
         e.printStackTrace();
         finish();
      }
      
      return null;
   }

   /**
    * @param args
    */
   public static void main(String[] args) {
      
      Main app = new Main();
      
      app.setDialogBehaviour(SimpleGame.FIRSTRUN_OR_NOCONFIGFILE_SHOW_PROPS_DIALOG, "data/spacemonkeys.png");               
      app.start();
      app.setLogicTicksPerSecond(10);
      
   }

   /**
    *  Alle Spieldaten entladen
    */
   protected void cleanup() {
      
      TextureManager.doTextureCleanup();
      
   }

   /**
    *  Initialisiert das Spiel, indem der Scene Graph aufgesetzt wird
    *  und Daten, wie Texturen, Models, Licht, Nodes etc. geladen werden.
    */
   protected void initGame() {

      Box box = new Box("W

The mistake is in your zbuffer.  You want it to actually be:


zbuffer.setFunction(ZBufferState.CF_LEQUAL);

Thanks a bunch, renanse!

It was really only that single line.  ://