Package com.sun.j3d.utils.universe

Examples of com.sun.j3d.utils.universe.ViewingPlatform


        if (_viewers.containsKey(canvas)) {
            throw new IllegalArgumentException("canvas already exists");
        }
        Viewer viewer = new Viewer(canvas);
        viewer.getView().setMinimumFrameCycleTime(30);
        ViewingPlatform viewingPlatform = new ViewingPlatform(1);
        viewingPlatform.setNominalViewingTransform();
        _rootLocale.addBranchGraph(viewingPlatform);
        viewer.setViewingPlatform(viewingPlatform);
        _viewers.put(canvas, viewer);
        for (Listener l : _listeners) {
            l.notifyChange();
View Full Code Here


        this.offScreenImageSupported = Boolean.FALSE;
      } else {
        SimpleUniverse universe = null;
        try {
          // Create a universe bound to no canvas 3D
          ViewingPlatform viewingPlatform = new ViewingPlatform();
          Viewer viewer = new Viewer(new Canvas3D [0]);
          universe = new SimpleUniverse(viewingPlatform, viewer);    
          // Create a dummy 3D image to check if it can be rendered in current Java 3D configuration
          getOffScreenImage(viewer.getView(), 1, 1);
          this.offScreenImageSupported = Boolean.TRUE;
View Full Code Here

   */
  private SimpleUniverse createUniverse(boolean displayShadowOnFloor,
                                        boolean listenToHomeUpdates,
                                        boolean waitForLoading) {
    // Create a universe bound to no canvas 3D
    ViewingPlatform viewingPlatform = new ViewingPlatform();
    // Add an interpolator to view transform to get smooth transition
    TransformGroup viewPlatformTransform = viewingPlatform.getViewPlatformTransform();
    CameraInterpolator cameraInterpolator = new CameraInterpolator(viewPlatformTransform);
    cameraInterpolator.setSchedulingBounds(new BoundingSphere(new Point3d(), 1E7));
    viewPlatformTransform.addChild(cameraInterpolator);
    viewPlatformTransform.setCapability(TransformGroup.ALLOW_CHILDREN_READ);
   
View Full Code Here

    View view = new View();
    view.setPhysicalBody(physicalBody);
    view.setPhysicalEnvironment(physicalEnvironment);
    view.setProjectionPolicy(projectionPolicy);
    // Create a viewing platform and attach it to view and universe locale
    ViewingPlatform viewingPlatform = new ViewingPlatform();
    viewingPlatform.setUniverse(this.universe);
    this.universe.getLocale().addBranchGraph(
        (BranchGroup)viewingPlatform.getViewPlatformTransform().getParent());
    view.attachViewPlatform(viewingPlatform.getViewPlatform());

    // Set user point of view depending on yaw and pitch angles
    updateViewPlatformTransform(viewingPlatform.getViewPlatformTransform(), yaw, pitch, scale);
    return view;
  }
View Full Code Here

    /**
     * Setup our view so we are able to see the elements
     * in the scene
     */
    private void setupView() {
        ViewingPlatform vp = universe.getViewingPlatform();
        TransformGroup steerTG = vp.getViewPlatformTransform();

        Transform3D t3d = new Transform3D();
        steerTG.getTransform(t3d);

        // args are: viewer posn, where looking, up direction
View Full Code Here

    private void orbitControls(Canvas3D c) {
      OrbitBehavior orbit =
        new OrbitBehavior(c, OrbitBehavior.REVERSE_ALL);
      orbit.setSchedulingBounds(bounds);

      ViewingPlatform vp = universe.getViewingPlatform();
      vp.setViewPlatformBehavior(orbit);  
    }
View Full Code Here

    // This will move the ViewPlatform back a bit so the
    // objects in the scene can be viewed.
    universe.getViewingPlatform().setNominalViewingTransform();
    universe.addBranchGraph(scene);
   
        ViewingPlatform viewingPlatform = universe.getViewingPlatform();
        viewingPlatform.setNominalViewingTransform();
        // add orbit behavior to ViewingPlatform
        OrbitBehavior   orbit = new OrbitBehavior(canvas, OrbitBehavior.REVERSE_ALL |
                OrbitBehavior.STOP_ZOOM);
        orbit.setSchedulingBounds(boundingSphere);
        viewingPlatform.setViewPlatformBehavior(orbit);

       
       
    return universe;
 
View Full Code Here

        userView.setBackClipDistance(BACK_CLIP_DISTANCE);
        userView.setFrontClipDistance(FRONT_CLIP_DISTANCE);
    }

    private void setKeyBehavior() {
        final ViewingPlatform vp = simpleUniverse.getViewingPlatform();
        final KeyBehavior keyBehavior = new KeyBehavior(mazeManager.getMaze());
        keyBehavior.setSchedulingBounds(bounds);
        vp.setViewPlatformBehavior(keyBehavior);
    }
View Full Code Here

TOP

Related Classes of com.sun.j3d.utils.universe.ViewingPlatform

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.