Time for action – meshing around with cubes
The following code sample is again based on the familiar BasicGame template that creates a blue cube.
- Make a copy of
Main.java
and name the classWireframeShapes.java
. Remember to also refactor the first line of themain()
method to:WireframeShapes app = new WireframeShapes();
- In the
simpleInitApp()
method, after the creation of the materialmat
, 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.