O'Reilly logo

jMonkeyEngine 3.0 Beginner's Guide by Ruth Kusterer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – splat goes the texture

You see how easy it is to create and texture a terrain in the SDK—but you can of course achieve the same with hand-drawn textures and hand-written Java code.

First, we create a heightmap for our terrain by performing the following steps:

  1. Create a grayscale PNG image in a graphic editor of your choice. The size must be a square power of two; for example, 512 px x 512 px.
  2. Use a spray or brush tool to outline the terrain's elevation in grayscales, where white represents high and black low.
  3. Save the heightmap as assets/Textures/Terrain/heightmap.png.

Next, we draw the alphamap that specifies where the grass, rock, and road textures go.

  1. Create an empty 32-bit RGBA color image. The size must be a square power of two; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required