O'Reilly logo

jMonkeyEngine 3.0 Beginner's Guide by Ruth Kusterer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – fortify the town

We start with a simple game that loads a model of a town:

  1. Make a copy of Main.java and name the class PhysicsTown.java. Remember to also refactor the first line of the main() method to the following:
    PhysicsTown app = new PhysicsTown();
  2. Download a sample town model in the Ogre DotScene format from http://jmonkeyengine.googlecode.com/svn/trunk/engine/town.zip. Save it directly into your project directory (not into assets/).
  3. Register a com.jme3.asset.plugins.ZipLocator for town.zip to the assetManager. Now you can use the assetManager to load the model's main.scene into the sceneNode class field. Since the model is quite small, scale it a bit bigger. As always, you attach the loaded model to the rootNode. Remember ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required