Package javax.vecmath

Examples of javax.vecmath.Color3f


        polyAttrib.setCullFace(PolygonAttributes.CULL_NONE);
        materialAppear.setPolygonAttributes(polyAttrib);

        Material material = new Material();
        // Might want to look into using a Color4b at some point
        material.setAmbientColor(new Color3f(color));
        materialAppear.setMaterial(material);

        return materialAppear;
    }
View Full Code Here


    TransformGroup sphereTrans = new TransformGroup();
    sphereTrans.addChild(sph);

    objRoot.addChild(sphereTrans);

    AmbientLight aLgt = new AmbientLight(new Color3f(0.2f, 0.2f, 0.2f));
    objRoot.addChild(aLgt);

    locale.addBranchGraph(objRoot);
   
   
View Full Code Here

    scene.detach();
    objRoot.setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND);
    objRoot.addChild(sphereTrans);

    AmbientLight aLgt = new AmbientLight(new Color3f(0.2f, 0.2f, 0.2f));
    objRoot.addChild(aLgt);
   
    scene.attach();
  }
View Full Code Here

        branchgroup.setCapability(BranchGroup.ALLOW_CHILDREN_WRITE);
        branchgroup.setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND);
       
        // TODO use light factories

        AmbientLight alight = new AmbientLight(true,new Color3f(0.5f,0.5f,0.5f));
        alight.setEnable(true);
        rootGroup.addChild(alight);
        BoundingSphere bounds = new BoundingSphere (new Point3d (0, 0.0, 0), 1E100);
        alight.setInfluencingBounds(bounds);

        lights = new DirectionalLight[1];

        for (int i=0; i<lights.length; ++i) {
          // TODO : position lights around the object
            lights[i] = new DirectionalLight(true,new Color3f(1.0f,1.0f,1.0f),new Vector3f(-1,-1,-1));
            lights[i].setCapability(DirectionalLight.ALLOW_DIRECTION_READ);
            lights[i].setCapability(DirectionalLight.ALLOW_DIRECTION_WRITE);
            lights[i].setCapabilityIsFrequent(DirectionalLight.ALLOW_DIRECTION_READ);
            lights[i].setCapabilityIsFrequent(DirectionalLight.ALLOW_DIRECTION_WRITE);
            lights[i].setEnable(true);
View Full Code Here

        branchgroup.setCapability(BranchGroup.ALLOW_CHILDREN_WRITE);
        branchgroup.setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND);
       
        // TODO use light factories

        AmbientLight alight = new AmbientLight(true,new Color3f(0.5f,0.5f,0.5f));
        alight.setEnable(true);
        rootGroup.addChild(alight);
        BoundingSphere bounds = new BoundingSphere (new Point3d (0, 0.0, 0), 1E100);
        alight.setInfluencingBounds(bounds);

        lights = new DirectionalLight[1];

        for (int i=0; i<lights.length; ++i) {
          // TODO : position lights around the object
            lights[i] = new DirectionalLight(true,new Color3f(1.0f,1.0f,1.0f),new Vector3f(-1,-1,-1));
            lights[i].setCapability(DirectionalLight.ALLOW_DIRECTION_READ);
            lights[i].setCapability(DirectionalLight.ALLOW_DIRECTION_WRITE);
            lights[i].setCapabilityIsFrequent(DirectionalLight.ALLOW_DIRECTION_READ);
            lights[i].setCapabilityIsFrequent(DirectionalLight.ALLOW_DIRECTION_WRITE);
            lights[i].setEnable(true);
View Full Code Here

    sphereTrans.addChild(sph);
    sphereTrans.setName("t1");

    bg.addChild(sphereTrans);

    AmbientLight aLgt = new AmbientLight(new Color3f(0.2f, 0.2f, 0.2f));
    aLgt.setName("l1");
    bg.addChild(aLgt);
   
    VirtualUniverse v2=new VirtualUniverse();
    Locale l2=new Locale();
View Full Code Here

        rootGroup = new BranchGroup();
        rootGroup.setName(name);
        rootGroup.setUserData(this);
        rootGroup.setPickable(true);
       
        AmbientLight alight = new AmbientLight(true,new Color3f(0.5f,0.5f,0.5f));
        rootGroup.addChild(alight);
       
        lights = new DirectionalLight[1];

        for (int i=0; i<lights.length; ++i) {
          // TODO : position lights around the object
            lights[i] = new DirectionalLight(true,new Color3f(1.0f,1.0f,1.0f),new Vector3f(-1,-1,-1));
          rootGroup.addChild(lights[i]);
        }
       
        rootGroup.addChild(branchgroup);
        locale.addBranchGraph(rootGroup);
View Full Code Here

        objTrans.setTransform(t3dTrans);
        objRoot.addChild(objTrans);
        BoundingSphere bounds = new BoundingSphere(new Point3d(0.0, 0.0, 0.0),
                100.0);
        // Set up the ambient light
        Color3f ambientColor = new Color3f(0.3f, 0.3f, 0.3f);
        AmbientLight ambientLightNode = new AmbientLight(ambientColor);
        ambientLightNode.setInfluencingBounds(bounds);
        objRoot.addChild(ambientLightNode);
        // Set up one directional lights
        Color3f light1Color = new Color3f(1.0f, 1.0f, 0.9f);
        Vector3f light1Direction = new Vector3f(1.0f, 1.0f, 1.0f);
        DirectionalLight light1 = new DirectionalLight(light1Color,
                light1Direction);
        light1.setInfluencingBounds(bounds);
        objRoot.addChild(light1);
View Full Code Here

            super(object, ShadingColor);
        }

        @Override
        public Color3f getPropertyValue() {
            Color3f res=new Color3f();
            if(_object.getColoringAttributes()!=null){
                _object.getColoringAttributes().getColor(res);
            }
            return res;
        }
View Full Code Here

    void set(Color c) {
        _color = c;
        setBackground(_color);
        if(_editor!=null){
            _editor.setNewValue(new Color3f(_color));
        }
    }
View Full Code Here

TOP

Related Classes of javax.vecmath.Color3f

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.