Package javax.media.j3d

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


    orientation.mul(scale);
    // Translate it to its location
    Transform3D pieceTransform = new Transform3D();
    pieceTransform.setTranslation(new Vector3f(
        piece.getX(), piece.getElevation() + piece.getHeight() / 2, piece.getY()));     
    pieceTransform.mul(orientation);
   
    // Change model transformation     
    ((TransformGroup)getChild(0)).setTransform(pieceTransform);
  }
 
View Full Code Here


                                            new Point3d(0.1,0.15,0.1)));
    cyli.setCollidable(true);

    //Position the cylinder and assign it to a transformation group.
    Transform3D tfCylinder = new Transform3D();
    tfCylinder.mul(rotationX);
    Transform3D positionCyl = new Transform3D();
    positionCyl.setTranslation(new Vector3f(-0.7f,0.0f,0.0f));
    tfCylinder.mul(positionCyl);

    TransformGroup tgCylinder = new TransformGroup(tfCylinder);
View Full Code Here

    Box fBox2 = new Box(cubeEdge,cubeEdge,cubeEdge,fBoxApp2);


    //Position the cube.
    Transform3D tfFBox2 = new Transform3D();
    tfFBox2.mul(rotationX);
    TransformGroup tgFBox2 = new TransformGroup(tfFBox2);

    //The transformation group for the right cube.
    tgFBox2.addChild(fBox2);
View Full Code Here

    private void initializeViewPosition() {
        final TransformGroup steerTransformGroup = simpleUniverse
                .getViewingPlatform().getViewPlatformTransform();
        final Transform3D transform = Transforms
                .getTransform(steerTransformGroup);
        transform.mul(Transforms.rotY(-Math.PI));
        transform.setTranslation(mazeManager.getStartPosition());
        steerTransformGroup.setTransform(transform);
    }

    private void prepareViewpoint() {
View Full Code Here

        this.bg = bg;
    }

    private void doRotateY(double radians) {
        final Transform3D transform3D = Transforms.getTransform(targetTG);
        transform3D.mul(Transforms.rotY(radians));
        targetTG.setTransform(transform3D);
    }

    @Override
    public void initialize() {
View Full Code Here

    }

    private void moveBy(Vector3d theMove) {
        final Transform3D transform3D = Transforms.getTransform(targetTG);
        final Vector3d start = Transforms.getVector3d(transform3D);
        transform3D.mul(Transforms.translation(theMove));
        final Transform3D transform2 = new Transform3D(transform3D);
        final Vector3d theMove2 = new Vector3d(theMove);
        theMove2.scale(5.0);
        transform2.mul(Transforms.translation(theMove2));
        final Vector3d stop = Transforms.getVector3d(transform2);
View Full Code Here

        final Vector3d start = Transforms.getVector3d(transform3D);
        transform3D.mul(Transforms.translation(theMove));
        final Transform3D transform2 = new Transform3D(transform3D);
        final Vector3d theMove2 = new Vector3d(theMove);
        theMove2.scale(5.0);
        transform2.mul(Transforms.translation(theMove2));
        final Vector3d stop = Transforms.getVector3d(transform2);
        pickTool.setShapeSegment(new Point3d(start), new Point3d(stop));
        if (pickTool.pickClosest() == null) {
            targetTG.setTransform(transform3D);
        }
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.