Package javax.media.j3d

Examples of javax.media.j3d.Node


                0.05f), new Color3f(0.15f, 0.15f, 0.15f));
    }

    public void testGeometry() {
        BasicTreeLeaf3D leaf3D = new BasicTreeLeaf3D(mockUniverse3D, leaf3DState, mockLeaf);
        Node node = leaf3D.getNode();
        CompilerHelper.compile(node);
        Shape3D leafShape3D = (Shape3D) node;

        // test position and geometry
        Geometry leafGeometry = leafShape3D.getGeometry();
View Full Code Here


        BasicTreeBranch3D branch3D = new BasicTreeBranch3D(mockUniverse3D, branch3DState, mockBranch);
        CompilerHelper.compile(branch3D.getGroup());
        assertEquals(nbParts, branch3D.getBranchParts().size());
        List<TreeBranchPart> parts = mockBranch.getParts();
        assertEquals(parts.get(parts.size() - 1).getBranchPart3D().getEndPoint(), branch3D.getEndPoint());
        Node firstChild = branch3D.getGroup().getChild(0);
        assertTrue(firstChild instanceof BranchGroup);
        BranchGroup branchGroup = (BranchGroup) firstChild;
        int nbPartsFound = 0;
        Structure3DHelper.assertExactlyOneTransformGroup(branchGroup);
        TransformGroup firstTransformGroup = (TransformGroup) branchGroup.getChild(0);
View Full Code Here

                Vector3d expectedTranslationVector = new Vector3d(leafAttachPoint);
                VectorTestHelper.assertVectorEquals(expectedTranslationVector, translationVector);

                // test one leaf found
                Structure3DHelper.assertExactlyOneShape3D(transformGroup);
                Node specificLeafNode = (Node) transformGroup.getChild(0);
                assertNotNull(specificLeafNode);
                nbLeavesFound++;
            } else {
                if (child instanceof Shape3D) {
                    nbTimesNoLeafShapeIsFound++;
View Full Code Here

        this.universe3D = universe3D;
    }

    public void fall(BranchGroup groupToFall) {
        TransformGroup tg = (TransformGroup) groupToFall.getChild(0);
        Node node = tg.getChild(0);
        // get the global transform before detaching to get all the transforms along the way
        // the group will not be attached locally anymore, but at the root,
        // so we need to get the global transform.
        Transform3D transform3D = getGlobalTransform3D(node);
        // we need to detach before changing the global transform, or it will move the group too far
View Full Code Here

TOP

Related Classes of javax.media.j3d.Node

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.