Package javax.vecmath

Examples of javax.vecmath.Matrix3d


        if (delta == null) delta = new Vector3d();
        delta.sub(n, p);
        delta.normalize();
        System.err.println("p->n direction: " + delta);
        Matrix3d hMatrix = new Matrix3d();
        // check using the the javax.vecmath routine
        hMatrix.m00 = h11;
        hMatrix.m01 = h12;
        hMatrix.m02 = h13;
        hMatrix.m10 = h12; // h21 = h12
        hMatrix.m11 = h22;
        hMatrix.m12 = h23;
        hMatrix.m20 = h13; // h31 = h13
        hMatrix.m21 = h23; // h32 = h22
        hMatrix.m22 = h33;
        hMatrix.invert();
        Point3d check = new Point3d(b1, b2, b3);
        hMatrix.transform(check);

        System.err.println("check point = " + check.x+" " +
      check.y+" " + check.z);
    }
View Full Code Here


  }

  public BranchGroup createSceneGraph2()
  {
      Java3DFactory objectFactory = new Java3DFactory();
    Matrix3d rot = new Matrix3d();
    rot.setIdentity();
    rot.rotZ(1.5);
    Transform3D zRotation = new Transform3D(rot, new Vector3d(), 1);
    TransformGroup objTrans3 = new TransformGroup(zRotation);
    objTrans3.addChild(objectFactory.createCylinder(0.5, 3, 2, 0, 0));
   
    Entry<BoundingSphere, BranchGroup> entry = Java3DUtils.createDefaultBranchGroup(
View Full Code Here

/*     */       }
/* 243 */       if ((!(this.elements.get(1) instanceof Point3d)) || (!(this.elements.get(2) instanceof Point3d)))
/*     */       {
/* 245 */         syntaxError(st, file, "All rows must have three elements");
/*     */       }
/* 247 */       return new Matrix3d(((Point3d)this.elements.get(0)).x, ((Point3d)this.elements.get(0)).y, ((Point3d)this.elements.get(0)).z, ((Point3d)this.elements.get(1)).x, ((Point3d)this.elements.get(1)).y, ((Point3d)this.elements.get(1)).z, ((Point3d)this.elements.get(2)).x, ((Point3d)this.elements.get(2)).y, ((Point3d)this.elements.get(2)).z);
/*     */     }
/*     */
/* 259 */     if ((this.elements.get(0) instanceof Point4d)) {
/* 260 */       if (this.elements.size() == 3) {
/* 261 */         if ((!(this.elements.get(1) instanceof Point4d)) || (!(this.elements.get(2) instanceof Point4d)))
View Full Code Here

/*     */   {
/* 246 */     Point3d n = new Point3d();
/* 247 */     Point3d p = new Point3d();
/* 248 */     Vector3d delta = null;
/*     */
/* 251 */     Matrix3d hMatrix = new Matrix3d();
/*     */
/* 313 */     double w = 100000000.0D;
/*     */
/* 316 */     int count = 0;
/* 317 */     p.set(g);
View Full Code Here

                TransformGroup transformGroup = (TransformGroup) leafBranchGroup.getChild(0);

                // test translation and rotation
                Transform3D transform3D = new Transform3D();
                transformGroup.getTransform(transform3D);
                Matrix3d rotationMatrix = new Matrix3d();
                Vector3d translationVector = new Vector3d();
                transform3D.get(rotationMatrix, translationVector);
                Matrix3d expectedRotationMatrix = new Matrix3d();
                TreeLeaf treeLeaf = mockBranchPart.getLeaves().get(nbLeavesFound);
                double rotation = treeLeaf.getTreeLeaf3D().getState().getRotation();
                expectedRotationMatrix.rotY(rotation);
                MatrixTestHelper.assertMatrixEquals(expectedRotationMatrix, rotationMatrix);
                Point3d leafAttachPoint = treeLeaf.getTreeLeaf3D().getState().getLeafAttachPoint().toPointValue();
                Vector3d expectedTranslationVector = new Vector3d(leafAttachPoint);
                VectorTestHelper.assertVectorEquals(expectedTranslationVector, translationVector);
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public final void multiply(final Matrix matrix) {
        final Matrix3d m;
        if (matrix instanceof Matrix3d) {
            m = (Matrix3d) matrix;
        } else {
            m = new Matrix3(matrix);
        }
View Full Code Here

                TransformGroup transformGroup = (TransformGroup) leafBranchGroup.getChild(0);

                // test translation and rotation
                Transform3D transform3D = new Transform3D();
                transformGroup.getTransform(transform3D);
                Matrix3d rotationMatrix = new Matrix3d();
                Vector3d translationVector = new Vector3d();
                transform3D.get(rotationMatrix, translationVector);
                Matrix3d expectedRotationMatrix = new Matrix3d();
                TreeLeaf treeLeaf = mockBranchPart.getLeaves().get(nbLeavesFound);
                double rotation = treeLeaf.getTreeLeaf3D().getState().getRotation();
                expectedRotationMatrix.rotY(rotation);
                MatrixTestHelper.assertMatrixEquals(expectedRotationMatrix, rotationMatrix);
                Point3d leafAttachPoint = treeLeaf.getTreeLeaf3D().getState().getLeafAttachPoint().toPointValue();
                Vector3d expectedTranslationVector = new Vector3d(leafAttachPoint);
                VectorTestHelper.assertVectorEquals(expectedTranslationVector, translationVector);
View Full Code Here

TOP

Related Classes of javax.vecmath.Matrix3d

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.