Package com.jme3.scene

Examples of com.jme3.scene.Geometry


    }

    @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

    /*
    b.setMode(Mesh.Mode.Points);
    b.setPointSize(10f);
    b.setStatic();
    */
    Geometry g = new Geometry("Bubble", b);
    g.rotate(FastMath.HALF_PI, 0, FastMath.HALF_PI);
    //g.scale(1, 1, -1);
    Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    Texture tex = assetManager.loadTexture("Textures/test3.png");
    mat.setTexture("ColorMap", tex);
    //mat.setColor("Color", ColorRGBA.Blue);
    //mat.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Off);
    g.setMaterial(mat);
   
    rootNode.attachChild(g);
   
    /*
    DirectionalLight sun = new DirectionalLight();
View Full Code Here

        offView.setOutputFrameBuffer(offBuffer);

        // setup framebuffer's scene
        Box boxMesh = new Box(Vector3f.ZERO, 1,1,1);
        Material material = assetManager.loadMaterial("Interface/Logo/Logo.j3m");
        offBox = new Geometry("box", boxMesh);
        offBox.setMaterial(material);

        // attach the scene to the viewport to be rendered
        offView.attachScene(offBox);
       
View Full Code Here

        cam.setLocation(new Vector3f(3, 3, 3));
        cam.lookAt(Vector3f.ZERO, Vector3f.UNIT_Y);

        //setup main scene
        //Geometry quad = new Geometry("box", new Box(Vector3f.ZERO, 1,1,1));
        Geometry g = new Geometry("Bubble", new Bubble(1f, 4f));
        Texture offTex = setupOffscreenView();

        Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        mat.setTexture("ColorMap", offTex);
        g.setMaterial(mat);
        rootNode.attachChild(g);
        inputManager.addMapping(TOGGLE_UPDATE, new KeyTrigger(KeyInput.KEY_SPACE));
        inputManager.addListener(this, TOGGLE_UPDATE);
    }
View Full Code Here

    /*
    b.setMode(Mesh.Mode.Points);
    b.setPointSize(10f);
    b.setStatic();
    */
    Geometry g = new Geometry("Bubble", b);
    Material mat = new Material(assetManager, "Common/MatDefs/Misc/SolidColor.j3md");
    mat.setColor("Color", ColorRGBA.Blue);
    mat.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Off);
    g.setMaterial(mat);
    rootNode.attachChild(g);
   
    /*
    DirectionalLight sun = new DirectionalLight();
    sun.setDirection(new Vector3f(1,0,-2).normalizeLocal());
View Full Code Here

  @Override
  public void simpleInitApp() {
    Ring r = new Ring(3f, 0.5f);
    r.setPointSize(10f);
    r.setStatic();
    Geometry g = new Geometry("geo_ring", r);
    Material mat = new Material(assetManager, "Common/MatDefs/Misc/SolidColor.j3md");
    mat.setColor("Color", ColorRGBA.Blue);
    mat.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Off);
    g.setMaterial(mat);
    rootNode.attachChild(g);

    DirectionalLight sun = new DirectionalLight();
    sun.setDirection(new Vector3f(1,0,-2).normalizeLocal());
    sun.setColor(ColorRGBA.White);
View Full Code Here

      Texture tex = assetManager.loadTexture("Textures/"+texture);
      planetSphere.setTextureMode(Sphere.TextureMode.Projected); // better quality on spheres
      TangentBinormalGenerator.generate(planetSphere);           // for lighting effect
      mat.setTexture("DiffuseMap", tex);
      mat.setFloat("Shininess", 0.0001f);
      planet = new Geometry("geo_"+name, planetSphere);
      planet.setMaterial(mat);
      planet.setShadowMode(ShadowMode.CastAndReceive);
      this.attachChild(planet);
     
      Sphere planetAtmosphere = new Sphere(48, 48, size*1.1f, false, true);
      Material matAtmosphere = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
      matAtmosphere.setColor("Color", new ColorRGBA(0,0,1,0.1f));
      matAtmosphere.getAdditionalRenderState().setBlendMode(BlendMode.AlphaAdditive);
      atmosphere = new Geometry("geo_"+name+"_atmosphere", planetAtmosphere);
      atmosphere.setMaterial(matAtmosphere);
      this.attachChild(atmosphere);
  }
View Full Code Here

TOP

Related Classes of com.jme3.scene.Geometry

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.