public void run(){ material.setColor("Color", ColorRGBA.randomColor()); } });
@Override public void simpleUpdate(float tpf){ time += tpf; if (time > 1f){ time -= 1f; prevColor = nextColor; nextColor = ColorRGBA.randomColor(); } ColorRGBA currentColor = new ColorRGBA(); currentColor.interpolateLocal(prevColor, nextColor, time); mat.setColor("Color", currentColor); }
/** A cube object for target practice */ protected Geometry makeCube(String name, float x, float y, float z) { Box box = new Box(1, 1, 1); Geometry cube = new Geometry(name, box); cube.setLocalTranslation(x, y, z); Material mat1 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat1.setColor("Color", ColorRGBA.randomColor()); cube.setMaterial(mat1); return cube; }
/** A cube object for target practice */ protected Geometry makeCube(String name, float x, float y, float z) { Box box = new Box(1, 1, 1); Geometry cube = new Geometry(name, box); cube.setLocalTranslation(x, y, z); Material mat1 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat1.setColor("Color", ColorRGBA.randomColor()); cube.setMaterial(mat1); return cube; }
@Override public void simpleInitApp() { Quad quadMesh = new Quad(512,512); Geometry quad = new Geometry("Quad", quadMesh); quad.setQueueBucket(Bucket.Gui); mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat.setTexture("ColorMap", assetManager.loadTexture("Textures/ColoredTex/Monkey.png")); quad.setMaterial(mat); guiNode.attachChildAt(quad, 0); nextColor = ColorRGBA.randomColor(); prevColor = ColorRGBA.Black; }
m.setColor("Color", ColorRGBA.randomColor()); cylinder.setMaterial(m); node.attachChild(cylinder);
m.setColor("Color", ColorRGBA.randomColor()); cylinder.setMaterial(m); node.attachChild(cylinder);
ColorRGBA creatureColor = creatureDebugColors.get(creature); if (creatureColor == null) { creatureColor = ColorRGBA.randomColor(); creatureDebugColors.put(creature, creatureColor);