Package com.jme3.light

Examples of com.jme3.light.DirectionalLight


    mat = new Material(assetManager, "MatDefs/SimpleAtmoshere.j3md");
   
    mat.setFloat("radius", radius);
    atmo = new Geometry("atmo_Planet", atmoSphere);
   
    Vector3f pos = new Vector3f(5,0,0);
    atmo.setLocalTranslation(pos);
    mat.setVector3("v3Center", pos);
   
   
    atmo.setMaterial(mat);
View Full Code Here


  @Override
  public void simpleUpdate(float tpf) {
    super.simpleUpdate(tpf);
   
    Vector3f camLocation = getCamera().getLocation();
    Material newMat = mat;
   
    Vector3f planetLocation = Vector3f.ZERO;
   
    newMat.setVector3("v3CameraPos", camLocation);
    /*
    float maxCamDistance = radius + planetLocation.subtract(camLocation).length();
    newMat.setFloat("maxCamDistance", maxCamDistance);
View Full Code Here

    @Override
    public void simpleUpdate(float tpf){
        angle += tpf;
        angle %= FastMath.TWO_PI;
       
        pl.setPosition(new Vector3f(FastMath.cos(angle) * 2f, 0.5f, FastMath.sin(angle) * 2f));
        lightMdl.setLocalTranslation(pl.getPosition());
    }
View Full Code Here

  public void addBloomFilter() {
    this.enqueue(new Callable<Integer>(){

      public Integer call() throws Exception {
        if (bloomFilter == null) {
          bloomFilter = new FilterPostProcessor(assetManager);
          BloomFilter bf = new BloomFilter(BloomFilter.GlowMode.Objects);
          bf.setBloomIntensity(2.0f);
          bf.setExposurePower(1.3f);
          bloomFilter.addFilter(bf);
          @SuppressWarnings("unused")
View Full Code Here

    this.enqueue(new Callable<Integer>(){

      public Integer call() throws Exception {
        if (bloomFilter == null) {
          bloomFilter = new FilterPostProcessor(assetManager);
          BloomFilter bf = new BloomFilter(BloomFilter.GlowMode.Objects);
          bf.setBloomIntensity(2.0f);
          bf.setExposurePower(1.3f);
          bloomFilter.addFilter(bf);
          @SuppressWarnings("unused")
          BloomUI bui = new BloomUI(inputManager, bf);
        }
        viewPort.addProcessor(bloomFilter);
View Full Code Here

    }

    @Override
    public void simpleInitApp() {
        Box b = new Box(Vector3f.ZERO, 1, 1, 1);
        Geometry geom = new Geometry("Box", b);
        geom.updateModelBound();

        Material mat = new Material(assetManager, "Common/MatDefs/Misc/SolidColor.j3md");
        mat.setColor("m_Color", ColorRGBA.Blue);
        geom.setMaterial(mat);

        rootNode.attachChild(geom);
    }
View Full Code Here

        if (model == null) {
          assetLogger.modelFinished();
          logger.log(Level.SEVERE, "Couldn't load model "+path);
          return null;
        }
        Geometry modelGeom = (Geometry) model.getChild(0);

        try {
          // trows an Exception if lod is not supported
          modelGeom.setLodLevel(0);

          LodControl control = new LodControl();
          modelGeom.addControl(control);
        } catch (Exception e) {}
        assetLogger.modelFinished();
        camNode.detachAllChildren();
        camNode.attachChild(model);
        return null;
View Full Code Here

  public void simpleInitApp() {
    Sphere atmoSphere = new Sphere(48, 48, radius, false, true);
    mat = new Material(assetManager, "MatDefs/SimpleAtmoshere.j3md");
   
    mat.setFloat("radius", radius);
    atmo = new Geometry("atmo_Planet", atmoSphere);
   
    Vector3f pos = new Vector3f(5,0,0);
    atmo.setLocalTranslation(pos);
    mat.setVector3("v3Center", pos);
   
   
    atmo.setMaterial(mat);
      rootNode.attachChild(atmo);
     
      Sphere planetSphere = new Sphere(48, 48, radius * 0.8f);
      Material planteMat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
      planteMat.setColor("Color", ColorRGBA.Green);
      Geometry planet = new Geometry("geo_Planet", planetSphere);
      planet.setLocalTranslation(pos);
      planet.setMaterial(planteMat);
      rootNode.attachChild(planet);
     
     
     
  }
View Full Code Here

        mat.setColor("m_Specular", ColorRGBA.Red);
       
        teapot.setMaterial(mat);
        rootNode.attachChild(teapot);

        lightMdl = new Geometry("Light", new Sphere(10, 10, 0.1f));
        lightMdl.setMaterial(assetManager.loadMaterial("Common/Materials/RedColor.j3m"));
        lightMdl.getMesh().setStatic();
        rootNode.attachChild(lightMdl);

        pl = new PointLight();
View Full Code Here

    /**
    @Override
     **/
    public void simpleInitApp(){
       
  Node node = new Node("My Root node");
  //Box b = new Box("MyBox",new Vector3f(0,0,0),new Vector3f(1,1,1));
  //rootNode.attachChild(b);

  AvatarXMLParser parser = new AvatarXMLParser();
  Avatar avatar = parser.getAvatarFromFile("art/mii/defaultBoy.xml");
  System.out.println(avatar);

  Avatar3DLoader loader = new Avatar3DLoader();
  Model model = loader.loadModel(avatar);

  // remove default light to see the colors
  //rootNode.setLightCombineMode(Spatial.LightCombineMode.Off);
        /*
  // Create a point light
  PointLight l = new PointLight();
  // Give it a location
  l.setLocation(new Vector3f(0, 10, 5));
  // Make it a red light
  //l.setDiffuse(ColorRGBA.red.clone());
  // Enable it
  l.setEnabled(true);
  // Create a LightState to put my light in
  LightState ls = display.getRenderer().createLightState();
  // Attach the light
  ls.attach(l);
  node.setRenderState(ls);
        */


  node.attachChild(model.root);
  rootNode.attachChild(node);

  //lightState.detachAll();
    }
View Full Code Here

TOP

Related Classes of com.jme3.light.DirectionalLight

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.