Package com.jme3.math

Examples of com.jme3.math.ColorRGBA


    public ModelPosition(){
  this(0,0,0, 0,0,0);
    }
    public ModelPosition(float x, float y, float z,
       float rotx, float roty, float rotz){
  location = new Vector3f(x,y,z);
  rotation = new Vector3f(rotx,roty,rotz);
    }
View Full Code Here


        // calc the y-axis
        float y = 1.5f-base.y*0.072f;
        //1.412 = 0
        //0.207 = 18

        rightEye.move(new Vector3f(xR,y,0.932f));
        leftEye.move(new Vector3f( xL, y, 0.932f ));

        head.attachChild(leftEye);
        head.attachChild(rightEye);
        return true;
    }
View Full Code Here

    assetManager.registerLocator("file:"+path, UrlLocator.class.getName());
  }
 
  public void setDirectionalLight(final boolean on) {
    if (dl == null) {
      Vector3f lightDir = new Vector3f(-0.8719428f, -0.46824604f, 0.14304268f);
      dl = new DirectionalLight();
      dl.setColor(new ColorRGBA(1.0f, 0.92f, 0.75f, 1f));
      dl.setDirection(lightDir);

      Vector3f lightDir2 = new Vector3f(0.70518064f, 0.5902297f, -0.39287305f);
      dl2 = new DirectionalLight();
      dl2.setColor(new ColorRGBA(0.7f, 0.85f, 1.0f, 1f));
      dl2.setDirection(lightDir2);
    }
    this.enqueue(new Callable<Integer>(){
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

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

     * @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());
View Full Code Here

        app.start();
    }

    @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);
View Full Code Here

TOP

Related Classes of com.jme3.math.ColorRGBA

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.