Time for action – meet the hover tank
The provided assets
directory contains the Models/HoverTank/Tank.j3o
model.
- Copy
Tank.j3o
and its four textures into a newassets/Models/HoverTank/
directory in your project. - Make a copy of
Main.java
and name the classHoverTank.java
. Remember to also refactor the first line of the main() method toHoverTank app = new HoverTank();
. - 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.