Package com.jme3.scene.shape

Examples of com.jme3.scene.shape.Quad


        cam.setFrustumPerspective(45f, (float)cam.getWidth() / cam.getHeight(), 1f, 1000f);
        cam.setLocation(new Vector3f(0f, 0f, 10f));
        cam.lookAt(new Vector3f(0f, 0f, 0f), Vector3f.UNIT_Y);
       

        renderManager = new RenderManager(renderer);
        //Remy - 09/14/2010 setted the timer in the renderManager
        renderManager.setTimer(timer);
        viewPort = renderManager.createMainView("Default", cam);
        viewPort.setClearEnabled(true);
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

    /*
    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

    /**
    @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

    public Node shirt;
    public Node skin;

// ============= Constructors ============== //
    public Model(){
  root = new Node("Model");
    }
View Full Code Here

    }
// ============= Public Methods ============== //
    public Model loadModel(Avatar avatar){
  // TEST, just load
  Model model = new Model();
  Node node = null;
  // load the body
  Node body = baseTable.loadBody(avatar.skin.color,avatar.shirt.color);
  Node head = baseTable.loadHead(avatar.head.type,avatar.skin.color);
        baseTable.loadEyes(avatar.eye,head);
  if(head != null && body != null){
      model.load(head,body);
  }
View Full Code Here

    /**
     * Handles loading a single node from file.
     * @param obj the path to the object.
     **/
    public Node loadNode(String obj){
  Node node = new Node();
  try{
            Spatial spatial = assetManager.loadModel(obj);
            //Material mat = new Material(assetManager, "Common/MatDefs/Misc/ShowNormals.j3md");
            //spatial.setMaterial(mat);
            node.attachChild(spatial);

      node.setModelBound(new BoundingSphere());
      node.updateModelBound();
  } catch (Exception e) {
            e.printStackTrace();
      //logger.logp(Level.SEVERE, this.getClass().toString(),"loadNode()", "Exception", e);
      node = null;
  }
View Full Code Here

TOP

Related Classes of com.jme3.scene.shape.Quad

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.