Package javax.media.j3d

Examples of javax.media.j3d.Transform3D


  private Transform3D getModelRotationTransform() {
    float [][] modelRotation = this.controller.getModelRotation();
    Matrix3f modelRotationMatrix = new Matrix3f(modelRotation [0][0], modelRotation [0][1], modelRotation [0][2],
        modelRotation [1][0], modelRotation [1][1], modelRotation [1][2],
        modelRotation [2][0], modelRotation [2][1], modelRotation [2][2]);
    Transform3D transform = new Transform3D();
    transform.setRotation(modelRotationMatrix);
    return transform;
  }
View Full Code Here


    frame.getContentPane().add("Center", canvas);
   
    peerComponent=frame;
    peerWindow=frame; 

    transform=new Transform3D();
    // avoids cumulative rounding errors
    // This should avoid "non-congruent transform above view transform" exception
    // Warning: In some cases, this exception still appears. This is a known J3D bug, that
    // should hopefully be corrected in J3D v1.4
    transform.setAutoNormalize(true);
    tempTransform=new Transform3D();
   
    viewingPlatform = scene.getUniverse().getViewingPlatform();
   
    viewer = viewingPlatform.getViewers()[0];
    view = viewer.getView();
View Full Code Here

        // Create the TransformGroup node and initialize it to the
        // identity. Enable the TRANSFORM_WRITE capability so that
        // our behavior code can modify it at run time. Add it to
        // the root of the subgraph.
        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);
View Full Code Here

    // TODO get platform and view according to persitent info and plugin support
    public ViewTransform(ViewingPlatform viewingPlatform) {
        _viewingMode = ROTATION_MODE;
        _viewingPlatform = viewingPlatform;
        _transform = new Transform3D();
        // avoids cumulative rounding errors
        // This should avoid "non-congruent transform above view transform"
        // exception
        _transform.setAutoNormalize(true);
        _tempTransform = new Transform3D();
        _zoom = new Matrix4f();
        _zoom.setIdentity();
        _rot = new Matrix4f();
        _rot.setIdentity();
        _trans = new Matrix4f();
View Full Code Here

        res._drotX=new Matrix4f(_drotX);
        res._drotY=new Matrix4f(_drotY);
        res._trans=new Matrix4f(_trans);
        res._vtrans=new Vector3f(_vtrans);

        res._transform = new Transform3D();
        res._transform.setAutoNormalize(true);
        res._tempTransform = new Transform3D();
       
        res._viewingPlatform=null;

        res._zoomAccumulator=null;
       
View Full Code Here

    }
   
    private void readObject(java.io.ObjectInputStream in)
                 throws IOException, ClassNotFoundException{
        in.defaultReadObject();
        _transform = new Transform3D();
        _transform.setAutoNormalize(true);
        _tempTransform = new Transform3D();
       
        _viewingPlatform=null;

        _zoomAccumulator=null;
    }
View Full Code Here

        return TransformValues.get(_oldValue, kind);
    }

    public void setNewValues(double[] values, TransformValues kind) {
        if (_newValue == null) {
            _newValue = new Transform3D();
        }
        kind.set(_newValue, values);
        compare();
        if (_changed)
            setPropertyValue(_newValue);
View Full Code Here

            return TransformValues.get(getPropertyValue(), kind);
        }

        @Override
        public Transform3D getPropertyValue() {
            Transform3D t1 = new Transform3D();
            _object.getTransform(t1);
            return t1;
        }
View Full Code Here

    // and translate it to the origin
    Bounds bounds = transformGroup.getBounds();
    if (bounds instanceof BoundingSphere) {
      Point3d center = new Point3d();
      ((BoundingSphere)bounds).getCenter(center);
      Transform3D tr = new Transform3D();
      tr.setScale(10.0/((BoundingSphere)bounds).getRadius());
      Transform3D tr2 = new Transform3D();
      center.negate();
      tr2.setTranslation(new Vector3f(center));
      tr.mul(tr2);
      transformGroup.setTransform(tr);
    }

    // Cleanup file name, use it for this node
View Full Code Here

  public void restoreTransform(TransformGroup group, TransformGroupNode node){
    super.restoreTransform(node);
    this.group = group;
   
    composedTrans =  new Transform3D();
    trans = new Transform3D();
    group.getTransform(trans);
    updateTransform();
    group.setTransform(trans);
    if (node!=null) node.setDirty();
  }
View Full Code Here

TOP

Related Classes of javax.media.j3d.Transform3D

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.