Examples of Point3d


Examples of javax.vecmath.Point3d

   
    final Background background = new Background(backgroundBranch);
    updateBackgroundColorAndTexture(backgroundAppearance, this.home, waitForLoading);
    background.setImageScaleMode(Background.SCALE_FIT_ALL);
    background.setApplicationBounds(new BoundingBox(
        new Point3d(-1E6, -1E6, -1E6),
        new Point3d(1E6, 1E6, 1E6)));   
   
    if (listenToHomeUpdates) {
      // Add a listener on sky color and texture properties change
      this.skyColorListener = new PropertyChangeListener() {
          public void propertyChange(PropertyChangeEvent ev) {
View Full Code Here

Examples of javax.vecmath.Point3d

      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

Examples of javax.vecmath.Point3d

      if (this.visualScene != null) {
        Transform3D rootTransform = new Transform3D();
        this.visualScene.getTransform(rootTransform);

        BoundingBox bounds = new BoundingBox(
            new Point3d(Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY),
            new Point3d(Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY));
        computeBounds(this.visualScene, bounds, new Transform3D());

        // Set orientation to Y_UP
        Transform3D axisTransform = new Transform3D();
        if ("Z_UP".equals(axis)) {
          axisTransform.rotX(-Math.PI / 2);
        } else if ("X_UP".equals(axis)) {
          axisTransform.rotZ(Math.PI / 2);
        }
        rootTransform.mul(axisTransform);
        // Translate model to its center
        Point3d lower = new Point3d();
        bounds.getLower(lower);
        if (lower.x != Double.POSITIVE_INFINITY) {
          Point3d upper = new Point3d();
          bounds.getUpper(upper);
          Transform3D translation = new Transform3D();
          translation.setTranslation(
              new Vector3d(-lower.x - (upper.x - lower.x) / 2,
                  -lower.y - (upper.y - lower.y) / 2,
View Full Code Here

Examples of javax.vecmath.Point3d

   * 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

Examples of javax.vecmath.Point3d

        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

Examples of javax.vecmath.Point3d

          bounds = ModelManager.getInstance().getBounds(model);
        } catch (IllegalArgumentException ex) {
          // Model is empty
        }
        if (bounds != null) {
          Point3d lower = new Point3d();
          bounds.getLower(lower);
          Point3d upper = new Point3d();
          bounds.getUpper(upper);
         
          // Translate model to center
          Transform3D translation = new Transform3D ();
          translation.setTranslation(
View Full Code Here

Examples of javax.vecmath.Point3d

   */
  protected void setModelRotation(float [][] modelRotation) {
    BranchGroup model = getModel();
    if (model != null && model.numChildren() > 0) {
      BoundingBox bounds = ModelManager.getInstance().getBounds(model);
      Point3d lower = new Point3d();
      bounds.getLower(lower);
      Point3d upper = new Point3d();
      bounds.getUpper(upper);
   
      // Translate model to center
      Transform3D translation = new Transform3D ();
      translation.setTranslation(
View Full Code Here

Examples of javax.vecmath.Point3d

  protected void setModelRotationAndSize(float [][] modelRotation,
                                         float width, float depth, float height) {
    BranchGroup model = getModel();
    if (model != null && model.numChildren() > 0) {
      BoundingBox bounds = ModelManager.getInstance().getBounds(model);
      Point3d lower = new Point3d();
      bounds.getLower(lower);
      Point3d upper = new Point3d();
      bounds.getUpper(upper);
     
      // Translate model to center
      Transform3D translation = new Transform3D ();
      translation.setTranslation(
View Full Code Here

Examples of javax.vecmath.Point3d

   * contrary to <code>node.getBounds()</code> that returns a bounding
   * sphere for a scene.
   */
  public Vector3f getSize(Node node) {
    BoundingBox bounds = getBounds(node);
    Point3d lower = new Point3d();
    bounds.getLower(lower);
    Point3d upper = new Point3d();
    bounds.getUpper(upper);
    return new Vector3f(Math.max(MINIMUM_SIZE, (float)(upper.x - lower.x)),
        Math.max(MINIMUM_SIZE, (float)(upper.y - lower.y)),
        Math.max(MINIMUM_SIZE, (float)(upper.z - lower.z)));
  }
View Full Code Here

Examples of javax.vecmath.Point3d

   * contrary to <code>node.getBounds()</code> that returns a bounding
   * sphere for a scene.
   */
  public BoundingBox getBounds(Node node) {
    BoundingBox objectBounds = new BoundingBox(
        new Point3d(Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY),
        new Point3d(Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY));
    computeBounds(node, objectBounds, new Transform3D());
    Point3d lower = new Point3d();
    objectBounds.getLower(lower);
    if (lower.x == Double.POSITIVE_INFINITY) {
      throw new IllegalArgumentException("Node has no bounds");
    }
    return objectBounds;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.