Time for action – oooh, shiny!

Shininess is an illumination property that gives onlookers a better idea whether the surface is smooth or rough. The Lighting.j3md material definition not only supports plain material colors but can also render specular highlights (what we colloquially call shininess) on top of the material colors.

Let's make a smooth geometry:

  1. Make a copy of Main.java and name the class MaterialColorShiny.java. Remember to also refactor the first line of the main() method to MaterialColorShiny app = new MaterialColorShiny();.
  2. Replace the blue cube code in the simpleInitApp() method with the following:
    Sphere sphereMesh = new Sphere(32,32, 1f); Geometry sphere1Geo = new Geometry("rough sphere", sphereMesh); Material sphere1Mat = new ...

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.