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 mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat.setColor("Color", ColorRGBA.Blue); mat.getAdditionalRenderState().setWireframe(true); geom.setMaterial(mat); rootNode.attachChild...