Time for action – meshing around with cubes

The following code sample is again based on the familiar BasicGame template that creates a blue cube.

  1. Make a copy of Main.java and name the class WireframeShapes.java. Remember to also refactor the first line of the main() method to: WireframeShapes app = new WireframeShapes();
  2. In the simpleInitApp() method, after the creation of the material mat, change the following material property: mat.getAdditionalRenderState().setWireframe(true);

    The WireframeShapes code sample now looks like the following code:

    public class WireframeShapes extends SimpleApplication { @Override public void simpleInitApp() { Box mesh = new Box(Vector3f.ZERO, 1, 1, 1); // create box mesh Geometry geom = new Geometry("Box", mesh); Material ...

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.