Examples of rotY()


Examples of javax.media.j3d.Transform3D.rotY()

        // add the leaf into a graph with translation and rotation
        Transform3D parentTransform3D = new Transform3D();
        Vector3d parentTranslation = new Vector3d(2, 3, 5);
        parentTransform3D.set(parentTranslation);
        Transform3D parentRotation = new Transform3D();
        parentRotation.rotY(Math.PI / 2);
        parentTransform3D.mul(parentRotation);
        TransformGroup parentTransformGroup = new TransformGroup(parentTransform3D);
        BranchGroup parentBranchGroup = new BranchGroup();
        parentTransformGroup.setCapability(Group.ALLOW_CHILDREN_WRITE);
        parentBranchGroup.addChild(parentTransformGroup);
View Full Code Here

Examples of javax.media.j3d.Transform3D.rotY()

        // Create a position interpolator and attach it to the view
        // platform
        TransformGroup vpTrans = univ.getViewingPlatform().getViewPlatformTransform();
        Transform3D axisOfTranslation = new Transform3D();
        Alpha transAlpha = new Alpha(-1,Alpha.INCREASING_ENABLE | Alpha.DECREASING_ENABLE, 0, 0,5000, 0, 0, 5000, 0, 0);
        axisOfTranslation.rotY(-Math.PI/2.0);
        PositionInterpolator translator =new PositionInterpolator(transAlpha,vpTrans,axisOfTranslation,2.0f, 3.5f);
        translator.setSchedulingBounds(bounds);
        objScale.addChild(translator);
        // Let Java 3D perform optimizations on this scene graph.
        objRoot.compile();
View Full Code Here

Examples of javax.media.j3d.Transform3D.rotY()

        Transform3D transform3D = new Transform3D();
        Vector3d graphTranslation = new Vector3d(oldLeafAttachPoint.getX(), oldLeafAttachPoint.getY(),
                oldLeafAttachPoint.getZ());
        transform3D.set(graphTranslation);
        Transform3D rotation = new Transform3D();
        rotation.rotY(oldRotation);
        transform3D.mul(rotation);
        TransformGroup transformGroup = new TransformGroup(transform3D);
        BranchGroup branchGroup = new BranchGroup();
        branchGroup.addChild(transformGroup);
        transformGroup.addChild(leaf3D.getBranchGroup());
View Full Code Here

Examples of javax.media.j3d.Transform3D.rotY()

    }

    public void testGetRotationFromTransformY() {
        Transform3D transform3D = new Transform3D();
        double rotationAngle = Randomizer.randomRotation();
        transform3D.rotY(rotationAngle);
        double angle = TransformerHelper.getRotationFromTransform(transform3D, Axis.Y);
        assertEquals(rotationAngle, angle, 0.000001);
    }

    public void testGetRotationFromTransformZ() {
View Full Code Here

Examples of javax.media.j3d.Transform3D.rotY()

        Transform3D transform3D = new Transform3D();
        Vector3d graphTranslation = new Vector3d(oldLeafAttachPoint.getX(), oldLeafAttachPoint.getY(),
                oldLeafAttachPoint.getZ());
        transform3D.set(graphTranslation);
        Transform3D rotation = new Transform3D();
        rotation.rotY(oldRotation);
        transform3D.mul(rotation);
        TransformGroup transformGroup = new TransformGroup(transform3D);
        BranchGroup branchGroup = new BranchGroup();
        branchGroup.addChild(transformGroup);
        transformGroup.addChild(leaf3D.getNode());
View Full Code Here

Examples of javax.media.j3d.Transform3D.rotY()

    }

    public void testGetRotationFromTransformY() {
        Transform3D transform3D = new Transform3D();
        double rotationAngle = Randomizer.randomRotation();
        transform3D.rotY(rotationAngle);
        double angle = TransformerHelper.getRotationFromTransform(transform3D, Axis.Y);
        assertEquals(rotationAngle, angle, 0.000001);
    }

    public void testGetRotationFromTransformZ() {
View Full Code Here

Examples of javax.media.j3d.Transform3D.rotY()

        switch (axis) {
        case X:
            rotation.rotX(rotationAngle);
            break;
        case Y:
            rotation.rotY(rotationAngle);
            break;
        case Z:
            rotation.rotZ(rotationAngle);
            break;
        }
View Full Code Here

Examples of javax.media.j3d.Transform3D.rotY()

        return transform;
    }

    public static Transform3D rotY(double radians) {
        final Transform3D toRotate = new Transform3D();
        toRotate.rotY(radians);
        return toRotate;
    }

    public static Transform3D translation(Vector3d theMove) {
        final Transform3D toMove = new Transform3D();
View Full Code Here

Examples of javax.vecmath.Matrix3d.rotY()

                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

Examples of javax.vecmath.Matrix3d.rotY()

                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
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.