use of com.jme3.scene.shape.Box in project jmonkeyengine by jMonkeyEngine.
the class TestMotionPath method createScene.
private void createScene() {
Material mat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
mat.setFloat("Shininess", 1f);
mat.setBoolean("UseMaterialColors", true);
mat.setColor("Ambient", ColorRGBA.Black);
mat.setColor("Diffuse", ColorRGBA.DarkGray);
mat.setColor("Specular", ColorRGBA.White.mult(0.6f));
Material matSoil = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
matSoil.setBoolean("UseMaterialColors", true);
matSoil.setColor("Ambient", ColorRGBA.Black);
matSoil.setColor("Diffuse", ColorRGBA.Black);
matSoil.setColor("Specular", ColorRGBA.Black);
teapot = assetManager.loadModel("Models/Teapot/Teapot.obj");
teapot.setName("Teapot");
teapot.setLocalScale(3);
teapot.setMaterial(mat);
rootNode.attachChild(teapot);
Geometry soil = new Geometry("soil", new Box(50, 1, 50));
soil.setLocalTranslation(0, -1, 0);
soil.setMaterial(matSoil);
rootNode.attachChild(soil);
DirectionalLight light = new DirectionalLight();
light.setDirection(new Vector3f(0, -1, 0).normalizeLocal());
light.setColor(ColorRGBA.White.mult(1.5f));
rootNode.addLight(light);
}
use of com.jme3.scene.shape.Box in project jmonkeyengine by jMonkeyEngine.
the class TestAppStateLifeCycle method simpleInitApp.
@Override
public void simpleInitApp() {
Box b = new Box(1, 1, 1);
Geometry geom = new Geometry("Box", b);
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg"));
geom.setMaterial(mat);
rootNode.attachChild(geom);
System.out.println("Attaching test state.");
stateManager.attach(new TestState());
}
use of com.jme3.scene.shape.Box in project jmonkeyengine by jMonkeyEngine.
the class TestEnqueueRunnable method simpleInitApp.
@Override
public void simpleInitApp() {
Geometry geom = new Geometry("Box", new Box(1, 1, 1));
Material material = new Material(getAssetManager(), "/Common/MatDefs/Misc/Unshaded.j3md");
//a color is needed to start with
material.setColor("Color", ColorRGBA.Blue);
geom.setMaterial(material);
getRootNode().attachChild(geom);
exampleAsyncTask = new ExampleAsyncTask(material);
exampleAsyncTask.getThread().start();
}
use of com.jme3.scene.shape.Box in project jmonkeyengine by jMonkeyEngine.
the class TestResizableApp method simpleInitApp.
public void simpleInitApp() {
flyCam.setDragToRotate(true);
Box b = new Box(1, 1, 1);
Geometry geom = new Geometry("Box", b);
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg"));
geom.setMaterial(mat);
rootNode.attachChild(geom);
txt = new BitmapText(loadGuiFont(), false);
txt.setText("Drag the corners of the application to resize it.\n" + "Current Size: " + settings.getWidth() + "x" + settings.getHeight());
txt.setLocalTranslation(0, settings.getHeight(), 0);
guiNode.attachChild(txt);
}
use of com.jme3.scene.shape.Box in project jmonkeyengine by jMonkeyEngine.
the class TestUseAfterFree method simpleInitApp.
@Override
public void simpleInitApp() {
Box box = new Box(1, 1, 1);
Geometry geom = new Geometry("Box", box);
mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg"));
geom.setMaterial(mat);
rootNode.attachChild(geom);
}
Aggregations