Time for action – meet the hover tank

The provided assets directory contains the Models/HoverTank/Tank.j3o model.

  1. Copy Tank.j3o and its four textures into a new assets/Models/HoverTank/ directory in your project.
  2. Make a copy of Main.java and name the class HoverTank.java. Remember to also refactor the first line of the main() method to HoverTank app = new HoverTank();.
  3. Replace the blue cube code in the simpleInitApp() method with the following:
    Node tank = (Node) assetManager.loadModel( "Models/HoverTank/Tank.j3o"); Material mat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md"); TextureKey tankDiffuse = new TextureKey("Models/HoverTank/tank_diffuse.jpg", false); mat.setTexture("DiffuseMap", assetManager.loadTexture(tankDiffuse)); ...

Get jMonkeyEngine 3.0 Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.