use of com.jme3.math.ColorRGBA in project jmonkeyengine by jMonkeyEngine.
the class TestPostFilters method setupLighting.
public void setupLighting() {
DirectionalLight dl = new DirectionalLight();
dl.setDirection(lightDir);
dl.setColor(new ColorRGBA(.9f, .9f, .9f, 1));
rootNode.addLight(dl);
dl = new DirectionalLight();
dl.setDirection(new Vector3f(1, 0, -1).normalizeLocal());
dl.setColor(new ColorRGBA(.4f, .4f, .4f, 1));
// rootNode.addLight(dl);
}
use of com.jme3.math.ColorRGBA in project jmonkeyengine by jMonkeyEngine.
the class TestOgreComplexAnim method simpleInitApp.
@Override
public void simpleInitApp() {
flyCam.setMoveSpeed(10f);
cam.setLocation(new Vector3f(6.4013605f, 7.488437f, 12.843031f));
cam.setRotation(new Quaternion(-0.060740203f, 0.93925786f, -0.2398315f, -0.2378785f));
DirectionalLight dl = new DirectionalLight();
dl.setDirection(new Vector3f(-0.1f, -0.7f, -1).normalizeLocal());
dl.setColor(new ColorRGBA(1f, 1f, 1f, 1.0f));
rootNode.addLight(dl);
Node model = (Node) assetManager.loadModel("Models/Oto/Oto.mesh.xml");
control = model.getControl(AnimControl.class);
AnimChannel feet = control.createChannel();
AnimChannel leftHand = control.createChannel();
AnimChannel rightHand = control.createChannel();
// feet will dodge
feet.addFromRootBone("hip.right");
feet.addFromRootBone("hip.left");
feet.setAnim("Dodge");
feet.setSpeed(2);
feet.setLoopMode(LoopMode.Cycle);
// will blend over 15 seconds to stand
feet.setAnim("Walk", 15);
feet.setSpeed(0.25f);
feet.setLoopMode(LoopMode.Cycle);
// left hand will pull
leftHand.addFromRootBone("uparm.right");
leftHand.setAnim("pull");
leftHand.setSpeed(.5f);
// will blend over 15 seconds to stand
leftHand.setAnim("stand", 15);
// right hand will push
rightHand.addBone("spinehigh");
rightHand.addFromRootBone("uparm.left");
rightHand.setAnim("push");
SkeletonDebugger skeletonDebug = new SkeletonDebugger("skeleton", control.getSkeleton());
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat.getAdditionalRenderState().setWireframe(true);
mat.setColor("Color", ColorRGBA.Green);
mat.getAdditionalRenderState().setDepthTest(false);
skeletonDebug.setMaterial(mat);
model.attachChild(skeletonDebug);
rootNode.attachChild(model);
}
use of com.jme3.math.ColorRGBA in project jmonkeyengine by jMonkeyEngine.
the class TestMonkeyHead method simpleInitApp.
@Override
public void simpleInitApp() {
viewPort.setBackgroundColor(ColorRGBA.DarkGray);
Spatial bumpy = (Spatial) assetManager.loadModel("Models/MonkeyHead/MonkeyHead.mesh.xml");
rootNode.attachChild(bumpy);
lightMdl = new Geometry("Light", new Sphere(10, 10, 0.1f));
lightMdl.setMaterial(assetManager.loadMaterial("Common/Materials/RedColor.j3m"));
rootNode.attachChild(lightMdl);
// flourescent main light
pl = new PointLight();
pl.setColor(new ColorRGBA(0.88f, 0.92f, 0.95f, 1.0f));
rootNode.addLight(pl);
// sunset light
DirectionalLight dl = new DirectionalLight();
dl.setDirection(new Vector3f(-0.1f, -0.7f, 1).normalizeLocal());
dl.setColor(new ColorRGBA(0.44f, 0.30f, 0.20f, 1.0f));
rootNode.addLight(dl);
// skylight
dl = new DirectionalLight();
dl.setDirection(new Vector3f(-0.6f, -1, -0.6f).normalizeLocal());
dl.setColor(new ColorRGBA(0.10f, 0.22f, 0.44f, 1.0f));
rootNode.addLight(dl);
// white ambient light
dl = new DirectionalLight();
dl.setDirection(new Vector3f(1, -0.5f, -0.1f).normalizeLocal());
dl.setColor(new ColorRGBA(0.50f, 0.40f, 0.50f, 1.0f));
rootNode.addLight(dl);
}
use of com.jme3.math.ColorRGBA in project jmonkeyengine by jMonkeyEngine.
the class TestAnimBlendBug method simpleInitApp.
@Override
public void simpleInitApp() {
inputManager.addMapping("One", new KeyTrigger(KeyInput.KEY_1));
inputManager.addListener(this, "One");
flyCam.setMoveSpeed(100f);
cam.setLocation(new Vector3f(0f, 150f, -325f));
cam.lookAt(new Vector3f(0f, 100f, 0f), Vector3f.UNIT_Y);
DirectionalLight dl = new DirectionalLight();
dl.setDirection(new Vector3f(-0.1f, -0.7f, 1).normalizeLocal());
dl.setColor(new ColorRGBA(1f, 1f, 1f, 1.0f));
rootNode.addLight(dl);
Node model1 = (Node) assetManager.loadModel("Models/Ninja/Ninja.mesh.xml");
Node model2 = (Node) assetManager.loadModel("Models/Ninja/Ninja.mesh.xml");
// Node model2 = model1.clone();
model1.setLocalTranslation(-60, 0, 0);
model2.setLocalTranslation(60, 0, 0);
AnimControl control1 = model1.getControl(AnimControl.class);
animNames = control1.getAnimationNames().toArray(new String[0]);
channel1 = control1.createChannel();
AnimControl control2 = model2.getControl(AnimControl.class);
channel2 = control2.createChannel();
SkeletonDebugger skeletonDebug = new SkeletonDebugger("skeleton1", control1.getSkeleton());
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat.getAdditionalRenderState().setWireframe(true);
mat.setColor("Color", ColorRGBA.Green);
mat.getAdditionalRenderState().setDepthTest(false);
skeletonDebug.setMaterial(mat);
model1.attachChild(skeletonDebug);
skeletonDebug = new SkeletonDebugger("skeleton2", control2.getSkeleton());
skeletonDebug.setMaterial(mat);
model2.attachChild(skeletonDebug);
rootNode.attachChild(model1);
rootNode.attachChild(model2);
}
use of com.jme3.math.ColorRGBA in project jmonkeyengine by jMonkeyEngine.
the class TestDebugShapes method putArrow.
public void putArrow(Vector3f pos, Vector3f dir, ColorRGBA color) {
Arrow arrow = new Arrow(dir);
putShape(arrow, color, 4).setLocalTranslation(pos);
}
Aggregations