Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: src/test/jme3test/model/shape/TestBox.java
- ===================================================================
- --- src/test/jme3test/model/shape/TestBox.java (revision 9461)
- +++ src/test/jme3test/model/shape/TestBox.java (working copy)
- @@ -34,12 +34,15 @@
- import com.jme3.app.SimpleApplication;
- import com.jme3.material.Material;
- +import com.jme3.math.ColorRGBA;
- import com.jme3.math.Vector3f;
- import com.jme3.scene.Geometry;
- import com.jme3.scene.shape.Box;
- public class TestBox extends SimpleApplication {
- + private Material mat;
- +
- public static void main(String[] args){
- TestBox app = new TestBox();
- app.start();
- @@ -49,10 +52,16 @@
- public void simpleInitApp() {
- Box b = new Box(Vector3f.ZERO, 1, 1, 1);
- Geometry geom = new Geometry("Box", b);
- - Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
- + mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
- mat.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg"));
- + mat.setColor("Color", ColorRGBA.randomColor());
- geom.setMaterial(mat);
- rootNode.attachChild(geom);
- }
- + @Override
- + public void simpleUpdate(float tpf) {
- + mat.setColor("Color", ColorRGBA.randomColor());
- + }
- +
- }
Advertisement
Add Comment
Please, Sign In to add comment