Time for action – lights on!

You can use any combination of light sources from the com.jme3.light package: ambient lights, directional lights, point lights, and spot lights. Remove the lights from HoverTank.java file's simpleInit() method, and add them back one by one to see the difference.

  1. Add an ambient light. Try multiplying the color by different scalars, larger or smaller than 1.0f, to increase or decrease its brightness. Note how it illuminates the whole scene evenly. Try setting the color to something other than White.
    AmbientLight ambient = new AmbientLight();
    ambient.setColor(ColorRGBA.White.mult(5f));
    rootNode.addLight(ambient);
  2. Remove the ambient light and add a point light. Move it to different locations to see the difference. Try different ...

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

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.