Package com.jme3.animation

Examples of com.jme3.animation.Bone


        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();
        pl.setColor(ColorRGBA.White);
        //pl.setRadius(3f);
        rootNode.addLight(pl);
    }
View Full Code Here


    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

  for(int i = 0; i < node.getQuantity(); i++){
      Spatial spatial = node.getChild(i);
      if(spatial instanceof Geometry){
                //Material material = new Material();
                AssetManager assetManager = JmeSystem.newAssetManager(Thread.currentThread().getContextClassLoader().getResource("com/jme3/asset/Desktop.cfg"));
                Material material = new Material(assetManager, "Common/MatDefs/Misc/SolidColor.j3md");
                material.setColor("m_Color",color);
                //Material geomMaterial = ((Geometry)spatial).getMaterial();
                spatial.setMaterial(material);
                System.out.println("Spatial: "+spatial.getName());
      }else if(spatial instanceof Node){
    setColor((Node)spatial,color);
View Full Code Here

     * Note, this is a recursive method.
     * @param node the node that contains children
     **/
    private void setColor(Geometry geometry, ColorRGBA color){
        AssetManager assetManager = JmeSystem.newAssetManager(Thread.currentThread().getContextClassLoader().getResource("com/jme3/asset/Desktop.cfg"));
        Material material = new Material(assetManager, "Common/MatDefs/Misc/SolidColor.j3md");
        material.setColor("m_Color",color);
        geometry.setMaterial(material);
        System.out.println("Spatial: "+geometry.getName());
    }
View Full Code Here

  private Geometry atmo;

  @Override
  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

  @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);
    float camToCenter = planetLocation.subtract(camLocation).length();
    newMat.setFloat("minCamDistance", FastMath.sqrt(camToCenter*camToCenter + radius*radius));
 
View Full Code Here

    @Override
    public void simpleInitApp() {
        Spatial teapot = assetManager.loadModel("Models/Teapot/Teapot.obj");
      
        teapot.setLocalScale(2f);
        Material mat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
        mat.setFloat("m_Shininess", 32f);
        mat.setBoolean("m_UseMaterialColors", true);

        mat.setColor("m_Ambient",  ColorRGBA.Black);
        mat.setColor("m_Diffuse",  ColorRGBA.Green);
        mat.setColor("m_Specular", ColorRGBA.Red);
       
        teapot.setMaterial(mat);
        rootNode.attachChild(teapot);

        lightMdl = new Geometry("Light", new Sphere(10, 10, 0.1f));
View Full Code Here

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

    init(radius, color);
  }
 
  private void init(float radius, ColorRGBA color) {
    //super("planet_marker", new Circle(radius*2));     
    Material mat = new Material(Pollux.get().getAssetManager(), "Common/MatDefs/Misc/ColoredTextured.j3md");
    mat.setColor("Color", color);
    mat.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Off);
    //mat.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
    //this.setQueueBucket(Bucket.Transparent);
    this.setMaterial(mat);
    hideMark();
  }
View Full Code Here

        eyesRV.add("Models/Eyes/Eye1R.j3o");
    }
    private void setupColors(){
  // setup skin colors
  skinColorV = new Vector<ColorRGBA>();
  skinColorV.add(new ColorRGBA(0.941f,0.859f,0.808f,1.0f));
  skinColorV.add(new ColorRGBA(0.965f,0.788f,0.580f,1.0f));
  skinColorV.add(new ColorRGBA(0.871f,0.627f,0.384f,1.0f));
  skinColorV.add(new ColorRGBA(0.957f,0.741f,0.616f,1.0f));
  skinColorV.add(new ColorRGBA(0.647f,0.380f,0.220f,1.0f));
  skinColorV.add(new ColorRGBA(0.376f,0.243f,0.145f,1.0f));
  // pants
  pantsColor = new ColorRGBA(0.05f,0.05f,0.05f,1f);
  // favorite colors
  favoriteColorV = new Vector<ColorRGBA>();
  favoriteColorV.add(new ColorRGBA(0.820f,0.282f,0.153f,1.0f));
  favoriteColorV.add(new ColorRGBA(0.953f,0.600f,0.282f,1.0f));
  favoriteColorV.add(new ColorRGBA(0.941f,0.812f,0.251f,1.0f));
  favoriteColorV.add(new ColorRGBA(0.643f,0.745f,0.216f,1.0f));
  favoriteColorV.add(new ColorRGBA(0.157f,0.447f,0.235f,1.0f));
  favoriteColorV.add(new ColorRGBA(0.133f,0.275f,0.651f,1.0f));
  favoriteColorV.add(new ColorRGBA(0.424f,0.651f,0.831f,1.0f));
  favoriteColorV.add(new ColorRGBA(0.961f,0.537f,0.537f,1.0f));
  favoriteColorV.add(new ColorRGBA(0.451f,0.224f,0.671f,1.0f));
  favoriteColorV.add(new ColorRGBA(0.463f,0.353f,0.231f,1.0f));
  favoriteColorV.add(new ColorRGBA(0.824f,0.824f,0.824f,1.0f));
  favoriteColorV.add(new ColorRGBA(0.263f,0.263f,0.263f,1.0f));

  //ColorV.add(new ColorRGBA(0.f,0.f,0.f,1.0f));
  //You can also use new ColorRGBA(0.0,1.0,0.0,1.0).
    }
View Full Code Here

TOP

Related Classes of com.jme3.animation.Bone

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.