Package javax.media.j3d

Examples of javax.media.j3d.Transform3D


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


   * @param preferredKind
   * @param fromNode
   */
  protected void init(int preferredKind, boolean fromNode){
    if(fromNode){
      Transform3D t = new Transform3D();
      group.getTransform(t);
      trans.set(t);
    }
    int k;
    if(preferredKind<0){
View Full Code Here

    }
  }
 
  public Object clone() throws CloneNotSupportedException{
    TransformDataJava3d res=(TransformDataJava3d)super.clone();
    res.trans=new Transform3D();
    res.v3=new Vector3d();
    res.m3=new Matrix3f();
    res.m4=new Matrix4f();
    res.q=new Quat4f();
    return res;
View Full Code Here

    protected TransformValues kind;

    /**
     */
    public TransformData() {
        trans = new Transform3D();

        kind = TransformValues.IDENTITY;
    }
View Full Code Here

    }

    public Object clone() throws CloneNotSupportedException {
        TransformData res = (TransformData) super.clone();

        res.trans = new Transform3D();
        return res;
    }
View Full Code Here

    }

    private void readObject(java.io.ObjectInputStream in)
            throws java.lang.ClassNotFoundException, java.io.IOException {
        in.defaultReadObject();
        trans = new Transform3D();
    }
View Full Code Here

            }
        }
       
        public TrValues(TransformValues k, TrValues v) {
            super(false);
            Transform3D trans=new Transform3D();
            v.kind.set(trans, v.doubleValues);
            kind=k;
            doubleValues=TransformValues.get(trans,k);
            data=new DataSource[doubleValues.length];
            if(v.data!=null){
View Full Code Here

           
            TransformGroup g=new TransformGroup();
            // TODO i18n
            g.setName("SolidFrame");
           
            Transform3D nz=new Transform3D();
            nz.rotZ(-Math.PI/2.);
            TransformGroup tgx=new TransformGroup(nz);
            tgx.setName("X");           
            makeSolidAxis(tgx, 1.f, 0.04f, 0.02f, 0.04f, Color.RED, Color.RED, 10);           
            g.addChild(tgx);

            TransformGroup tgy=new TransformGroup(new Transform3D());
            tgy.setName("Y");           
            makeSolidAxis(tgy, 1.f, 0.04f, 0.02f, 0.04f, Color.GREEN, Color.GREEN, 10);           
            g.addChild(tgy);
           
            Transform3D px=new Transform3D();
            px.rotX(Math.PI/2.);
            TransformGroup tgz=new TransformGroup(px);
            tgz.setName("Z");           
            makeSolidAxis(tgz, 1.f, 0.04f, 0.02f, 0.04f, Color.BLUE, Color.BLUE, 10);           
            g.addChild(tgz);
View Full Code Here

        ImportedFurnitureWizardStepsPanel.class, "orientationLabel.text"));
    this.turnLeftButton = new JButton(new ResourceAction(preferences,
            ImportedFurnitureWizardStepsPanel.class, "TURN_LEFT", true) {
        @Override
        public void actionPerformed(ActionEvent ev) {
          Transform3D oldTransform = getModelRotationTransform();
          Transform3D leftRotation = new Transform3D();
          leftRotation.rotY(-Math.PI / 2);
          leftRotation.mul(oldTransform);
          updateModelRotation(leftRotation);
        }
      });
    this.turnRightButton = new JButton(new ResourceAction(preferences,
            ImportedFurnitureWizardStepsPanel.class, "TURN_RIGHT", true) {
        @Override
        public void actionPerformed(ActionEvent ev) {
          Transform3D oldTransform = getModelRotationTransform();
          Transform3D rightRotation = new Transform3D();
          rightRotation.rotY(Math.PI / 2);
          rightRotation.mul(oldTransform);
          updateModelRotation(rightRotation);
        }
      });
    this.turnUpButton = new JButton(new ResourceAction(preferences,
            ImportedFurnitureWizardStepsPanel.class, "TURN_UP", true) {
        @Override
        public void actionPerformed(ActionEvent ev) {
          Transform3D oldTransform = getModelRotationTransform();
          Transform3D upRotation = new Transform3D();
          upRotation.rotX(-Math.PI / 2);
          upRotation.mul(oldTransform);
          updateModelRotation(upRotation);
        }
      });
    this.turnDownButton = new JButton(new ResourceAction(preferences,
            ImportedFurnitureWizardStepsPanel.class, "TURN_DOWN", true) {
        @Override
        public void actionPerformed(ActionEvent ev) {
          Transform3D oldTransform = getModelRotationTransform();
          Transform3D downRotation = new Transform3D();
          downRotation.rotX(Math.PI / 2);
          downRotation.mul(oldTransform);
          updateModelRotation(downRotation);
        }
      });
    this.backFaceShownLabel = new JLabel(preferences.getLocalizedString(
        ImportedFurnitureWizardStepsPanel.class, "backFaceShownLabel.text"));
View Full Code Here

   
    // 2. Write a box at center
    writer.writeNode(new Box());
   
    // Write a sphere centered at (2, 0, 2)
    Transform3D translation = new Transform3D();
    translation.setTranslation(new Vector3f(2f, 0, 2f));
    TransformGroup translationGroup = new TransformGroup(translation);
   
    translationGroup.addChild(new Sphere());
    writer.writeNode(translationGroup);
   
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.