Package com.jme3.math

Examples of com.jme3.math.ColorRGBA


  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

        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

 
  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>(){
      public Integer call() throws Exception {
        if (on) {
View Full Code Here

  }
 
  public void setAmbientLight(final boolean on) {
    if (al == null) {
      al = new AmbientLight();
      al.setColor(new ColorRGBA(1.0f, 0.92f, 0.75f, 1f));
    }
    this.enqueue(new Callable<Integer>(){
      public Integer call() throws Exception {
        if (on) {
          rootNode.addLight(al);
View Full Code Here

    });
  }
 
  private PointLight getPointLight() {
    PointLight ll = new PointLight();
    ll.setColor(new ColorRGBA(1.0f, 0.92f, 0.75f, 1f));
    ll.setRadius(20f);
    return ll;
  }
View Full Code Here

public class CircleMarker extends FacingGeometry implements Markable {

  public CircleMarker(float radius) {
    super("planet_marker", new Ring(radius*1.5f, radius*0.05f));
    ColorRGBA c = ColorRGBA.White;
    c.a = 0.5f;
    init(radius, c);
  }
View Full Code Here

  }
 
  private ParticleEmitter getEmitter(String name) {
    ParticleEmitter flame = new ParticleEmitter(name, Type.Triangle, 32);
        flame.setSelectRandomImage(true);
        flame.setStartColor(new ColorRGBA(1f, 0.4f, 0.05f, 1f));
        flame.setEndColor(new ColorRGBA(.4f, .22f, .12f, 0f));
        flame.setStartSize(1.3f);
        flame.setEndSize(2f);
        flame.setShape(new EmitterSphereShape(Vector3f.ZERO, 1f));
        flame.setParticlesPerSec(0);
        flame.setGravity(-5f);
View Full Code Here

      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

    public Creature(Graphics graphics, float size, float energyToEvolve) {
        super(graphics);
        this.size = size;
        this.energyToEvolve = energyToEvolve;
        this.color = new ColorRGBA(0.5f, 0.5f, 0.5f, 1f);
    }
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.