DirectionalLight
Directional lights have no specific position in the scene, they always come from their direction regardless of where an object is placed.
29303132333435363738394041
//move cam a bit closer cam.setLocation(cam.getLocation().mult(0.5f)); inputManager.setCursorVisible(true); DirectionalLight dr = new DirectionalLight(); dr.setColor(ColorRGBA.White); dr.setDirection(new Vector3f(1, 0 , 1)); AmbientLight am = new AmbientLight(); am.setColor(ColorRGBA.White); rootNode.addLight(am); rootNode.addLight(dr);
394041424344454647484950
em = Singleton.get().getNavManager(); am = AreaTerrainManager.get(); sm = Singleton.get().getSceneManager(); rootNode.attachChild(debugNodes); DirectionalLight light = new DirectionalLight(); light.setDirection((new Vector3f(-0.5f, -1f, -0.5f)).normalize()); rootNode.addLight(light); AmbientLight ambLight = new AmbientLight(); ambLight.setColor(new ColorRGBA(0.2f, 0.2f, 0.2f, 1f)); rootNode.addLight(ambLight);
353637383940414243444546
assetManager = new DesktopAssetManager(Thread.currentThread().getContextClassLoader().getResource("com/l2client/asset/loader.cfg")); em = Singleton.get().getNavManager(); rootNode.attachChild(debugNodes); DirectionalLight light = new DirectionalLight(); light.setDirection((new Vector3f(-0.5f, -1f, -0.5f)).normalize()); rootNode.addLight(light); AmbientLight ambLight = new AmbientLight(); ambLight.setColor(new ColorRGBA(0.2f, 0.2f, 0.2f, 1f)); rootNode.addLight(ambLight);
49505152535455565758596061
matWireframe.getAdditionalRenderState().setWireframe(true); man.loadParts("megaset.csv"); templates = man.getTemplates(); DirectionalLight dr = new DirectionalLight(); dr.setColor(ColorRGBA.White); dr.setDirection(new Vector3f(1, 0 , 1)); AmbientLight am = new AmbientLight(); am.setColor(ColorRGBA.White); rootNode.addLight(am); rootNode.addLight(dr);
int currentNode = 0; public void simpleInitApp() { man.loadParts("dwarf.csv"); DirectionalLight dr = new DirectionalLight(); dr.setColor(ColorRGBA.White); dr.setDirection(new Vector3f(1, 0 , 1)); AmbientLight am = new AmbientLight(); am.setColor(ColorRGBA.White); rootNode.addLight(am); rootNode.addLight(dr);
63646566676869707172737475
matWireframe.getAdditionalRenderState().setWireframe(true); man = Singleton.get().getPartManager(); man.loadParts("megaset.csv"); templates = man.getTemplates(); DirectionalLight dr = new DirectionalLight(); dr.setColor(ColorRGBA.White); dr.setDirection(new Vector3f(1, 0 , 1)); AmbientLight am = new AmbientLight(); am.setColor(ColorRGBA.White); rootNode.addLight(am); rootNode.addLight(dr);
34353637383940414243444546
public void simpleInitApp() { man.loadParts("megaset.csv"); templates = man.getTemplates(); DirectionalLight dr = new DirectionalLight(); dr.setColor(ColorRGBA.White); dr.setDirection(new Vector3f(1, 0 , 1)); AmbientLight am = new AmbientLight(); am.setColor(ColorRGBA.White); rootNode.addLight(am); rootNode.addLight(dr);
656667686970717273747576
js = sin.getJmeSystem(); ps = sin.getPosSystem(); tm.update(cam.getLocation()); rootNode.attachChild(debugNodes); DirectionalLight light = new DirectionalLight(); light.setDirection((new Vector3f(-0.5f, -1f, -0.5f)).normalize()); rootNode.addLight(light); AmbientLight ambLight = new AmbientLight(); ambLight.setColor(new ColorRGBA(0.2f, 0.2f, 0.2f, 1f)); rootNode.addLight(ambLight);
48495051525354555657585960
//move cam a bit closer cam.setLocation(cam.getLocation().mult(0.5f)); inputManager.setCursorVisible(true); flyCam.setEnabled(false); DirectionalLight dr = new DirectionalLight(); dr.setColor(ColorRGBA.White); dr.setDirection(new Vector3f(1, 0 , 1)); AmbientLight am = new AmbientLight(); am.setColor(ColorRGBA.White); rootNode.addLight(am); rootNode.addLight(dr);
238239240241242243244245246247248
// debug.getLocalTranslation().set(g00.getLocalTranslation()); // debug.getLocalScale().set(g00.getLocalScale()); // rootNode.attachChild(debug); } dl = new DirectionalLight(); dl.setColor(ColorRGBA.White); dl.setDirection((new Vector3f(0f, -1f, 0f)).normalizeLocal()); rootNode.addLight(dl); //