Package javax.media.j3d

Examples of javax.media.j3d.BoundingSphere


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


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

        TransformGroup objTrans = new TransformGroup();
        Transform3D t3dTrans = new Transform3D();
        objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
        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);
View Full Code Here

        }
        if (res instanceof BoundingSphere) {
            return (float)((BoundingSphere)res).getRadius();
        }
        // else, include this bounds object in a bounding sphere and get radius
        BoundingSphere bs=new BoundingSphere(res);
        return (float)bs.getRadius();
    }
View Full Code Here

    // Create a universe bound to no canvas 3D
    ViewingPlatform viewingPlatform = new ViewingPlatform();
    // Add an interpolator to view transform to get smooth transition
    TransformGroup viewPlatformTransform = viewingPlatform.getViewPlatformTransform();
    CameraInterpolator cameraInterpolator = new CameraInterpolator(viewPlatformTransform);
    cameraInterpolator.setSchedulingBounds(new BoundingSphere(new Point3d(), 1E7));
    viewPlatformTransform.addChild(cameraInterpolator);
    viewPlatformTransform.setCapability(TransformGroup.ALLOW_CHILDREN_READ);
   
    Viewer viewer = new Viewer(new Canvas3D [0]);
    SimpleUniverse universe = new SimpleUniverse(viewingPlatform, viewer);
View Full Code Here

      lights [i].setUserData(defaultColor);
      updateLightColor(lights [i]);
    }
   
    for (Light light : lights) {
      light.setInfluencingBounds(new BoundingSphere(new Point3d(), 1E7));
    }
   
    if (listenToHomeUpdates) {
      // Add a listener on light color property change to home
      this.lightColorListener = new PropertyChangeListener() {
View Full Code Here

   * Returns the background node. 
   */
  private Node getBackgroundNode() {
    Background background = new Background(new Color3f(0.9f, 0.9f, 0.9f));
    background.setCapability(Background.ALLOW_COLOR_WRITE);
    background.setApplicationBounds(new BoundingSphere(new Point3d(0, 0, 0), 100));
    return background;
  }
View Full Code Here

        new DirectionalLight(new Color3f(0.9f, 0.9f, 0.9f), new Vector3f(-1.732f, -0.8f, -1)),
        new DirectionalLight(new Color3f(0.9f, 0.9f, 0.9f), new Vector3f(0, -0.8f, 1)),
        new AmbientLight(new Color3f(0.2f, 0.2f, 0.2f))};

    for (Light light : lights) {
      light.setInfluencingBounds(new BoundingSphere(new Point3d(0, 0, 0), 100));
    }
    return lights;
  }
View Full Code Here

    addLight(simpUniv);


    //The following three lines enable navigation through the scene using the mouse.
    OrbitBehavior ob = new OrbitBehavior(myCanvas3D);
    ob.setSchedulingBounds(new BoundingSphere(new Point3d(0.0,0.0,0.0),Double.MAX_VALUE));
    simpUniv.getViewingPlatform().setViewPlatformBehavior(ob);


    //Show the canvas/window.
    setTitle("Statische Szene aus elementaren Objekten");
View Full Code Here

  public void addLight(SimpleUniverse su)
  {

    BranchGroup bgLight = new BranchGroup();

    BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), Double.MAX_VALUE);
    Color3f lightColour1 = new Color3f(1.0f,1.0f,1.0f);
    Vector3f lightDir1  = new Vector3f(-1.0f,0.0f,-0.5f);
    DirectionalLight light1 = new DirectionalLight(lightColour1, lightDir1);
    light1.setInfluencingBounds(bounds);
View Full Code Here

TOP

Related Classes of javax.media.j3d.BoundingSphere

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.