Time for action – let the hover tank be groovy

Currently, the surface of the hover tank looks a bit like a cheap toy: the grooves in the material look painted on, and the material looks more like plastic than metal. One thing you want to avoid is adding extra polygons to the mesh just to make the grooves three-dimensional.

Let's try a more professional solution and add a so-called normal map:

  1. Make sure you have the Models/HoverTank/tank_normals.png texture in your assets directory.
  2. This line generates the tangent data that describes your model's surface. Add it before the setMaterial() line in your HoverTank.java's simpleInit() method:
    TangentBinormalGenerator.generate(tank);
  3. Load the normal map into the material. Again, add these lines before the ...

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.