pl.setColor(new ColorRGBA(0.88f, 0.92f, 0.95f, 1.0f)); rootNode.addLight(pl);
@Override public void simpleInitApp() { Quad quadMesh = new Quad(1, 1); Geometry sphere = new Geometry("Rock Ball", quadMesh); Material mat = assetManager.loadMaterial("Textures/BumpMapTest/SimpleBump.j3m"); sphere.setMaterial(mat); TangentBinormalGenerator.generate(sphere); rootNode.attachChild(sphere); lightMdl = new Geometry("Light", new Sphere(10, 10, 0.1f)); lightMdl.setMaterial(assetManager.loadMaterial("Common/Materials/RedColor.j3m")); rootNode.attachChild(lightMdl); pl = new PointLight(); pl.setColor(ColorRGBA.White); pl.setPosition(new Vector3f(0f, 0f, 4f)); rootNode.addLight(pl); // DirectionalLight dl = new DirectionalLight(); // dl.setDirection(new Vector3f(1, -1, -1).normalizeLocal()); // dl.setColor(new ColorRGBA(0.22f, 0.15f, 0.1f, 1.0f)); // rootNode.addLight(dl); }
@Override public void simpleInitApp() { Sphere sphMesh = new Sphere(32, 32, 1); sphMesh.setTextureMode(Sphere.TextureMode.Projected); sphMesh.updateGeometry(32, 32, 1, false, false); TangentBinormalGenerator.generate(sphMesh); Geometry sphere = new Geometry("Rock Ball", sphMesh); Material mat = assetManager.loadMaterial("Textures/Terrain/Pond/Pond.j3m"); mat.setColor("Ambient", ColorRGBA.DarkGray); mat.setColor("Diffuse", ColorRGBA.White); mat.setBoolean("UseMaterialColors", true); sphere.setMaterial(mat); rootNode.attachChild(sphere); PointLight pl = new PointLight(); pl.setColor(ColorRGBA.White); pl.setPosition(new Vector3f(4f, 0f, 0f)); rootNode.addLight(pl); AmbientLight al = new AmbientLight(); al.setColor(ColorRGBA.White); rootNode.addLight(al); } }
@Override public void simpleInitApp() { Sphere sphMesh = new Sphere(32, 32, 1); sphMesh.setTextureMode(Sphere.TextureMode.Projected); sphMesh.updateGeometry(32, 32, 1, false, false); TangentBinormalGenerator.generate(sphMesh); Geometry sphere = new Geometry("Rock Ball", sphMesh); Material mat = assetManager.loadMaterial("Textures/Terrain/Pond/Pond.j3m"); sphere.setMaterial(mat); rootNode.attachChild(sphere); lightMdl = new Geometry("Light", new Sphere(10, 10, 0.1f)); lightMdl.setMaterial(assetManager.loadMaterial("Common/Materials/RedColor.j3m")); rootNode.attachChild(lightMdl); pl = new PointLight(); pl.setColor(ColorRGBA.White); pl.setPosition(new Vector3f(0f, 0f, 4f)); rootNode.addLight(pl); // DirectionalLight dl = new DirectionalLight(); // dl.setDirection(new Vector3f(1,-1,1).normalizeLocal()); // dl.setColor(new ColorRGBA(0.22f, 0.15f, 0.1f, 1.0f)); // rootNode.addLight(dl); }
for (int i = 0; i < pls.length; i++){ PointLight pl = new PointLight(); pl.setColor(colors[i % colors.length]); pl.setRadius(5); display.addLight(pl);
@Override public void simpleInitApp() { InstancedNode instancedNode = new InstancedNode("testInstancedNode"); rootNode.attachChild(instancedNode); box = new Geometry("Box", new Box(0.5f, 0.5f, 0.5f)); Material material = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md"); material.setBoolean("UseInstancing", true); material.setColor("Diffuse", ColorRGBA.Red); material.setBoolean("UseMaterialColors", true); box.setMaterial(material); instancedNode.attachChild(box); instancedNode.instance(); pointLight = new PointLight(); pointLight.setColor(ColorRGBA.White); pointLight.setRadius(10f); rootNode.addLight(pointLight); box.setLocalTranslation(new Vector3f(offset, 0, 0)); pointLight.setPosition(new Vector3f(offset - 3f, 0, 0)); cam.setLocation(new Vector3f(offset - 5f, 0, 0)); cam.lookAtDirection(Vector3f.UNIT_X, Vector3f.UNIT_Y); }
aLight.setColor(ColorRGBA.Red); rootNode.addLight(aLight);
pl.setColor(ColorRGBA.Green); pl.setRadius(4f); rootNode.addLight(pl);
pl.setColor(ColorRGBA.White);
pl.setColor(ColorRGBA.Green); pl.setRadius(4f); rootNode.addLight(pl);
@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); }
pl.setColor(ColorRGBA.White.mult(1.5f)); pl.setPosition(new Vector3f(0, 0, 1)); pl.setRadius(2);
@Override public void simpleInitApp() { Spatial signpost = (Spatial) assetManager.loadAsset(new OgreMeshKey("Models/Sign Post/Sign Post.mesh.xml")); signpost.setMaterial( (Material) assetManager.loadMaterial("Models/Sign Post/Sign Post.j3m")); TangentBinormalGenerator.generate(signpost); rootNode.attachChild(signpost); lightMdl = new Geometry("Light", new Sphere(10, 10, 0.1f)); lightMdl.setMaterial( (Material) 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); }
pl.setColor(ColorRGBA.White); pl.setRadius(4f); rootNode.addLight(pl);
pl.setColor(ColorRGBA.White); pl.setRadius(4f); rootNode.addLight(pl);
pl.setColor(ColorRGBA.White);
lamp_light.setColor(ColorRGBA.Yellow); lamp_light.setRadius(20f); lamp_light.setPosition(new Vector3f(210.0f, 0f, 210f));
box.setLocalTranslation(-1f, 0.5f, -2); ((PointLight) scene.getLocalLightList().get(0)).setColor(ColorRGBA.Red);