Package javax.media.j3d

Examples of javax.media.j3d.Canvas3D

The basic Java 3D monoscopic rendering loop is as follows:

In both cases, the entire loop, beginning with clearing the canvas and ending with swapping the buffers, defines a frame. The application is given the opportunity to render immediate-mode geometry at any of the clearly identified spots in the rendering loop. A user specifies his or her own rendering methods by extending the Canvas3D class and overriding the preRender, postRender, postSwap, and/or renderField methods. Updates to live Geometry, Texture, and ImageComponent objects in the scene graph are not allowed from any of these callback methods.

Serialization

Canvas3D does not support serialization. An attempt to serialize a Canvas3D object will result in an UnsupportedOperationException being thrown.

Additional Information

For more information, see the Introduction to the Java 3D API and View Model documents. @see Screen3D @see View @see GraphicsContext3D


   
    renderContext.setPickedVertexState(new MultiPickedState<V>());
    renderContext.setPickedEdgeState(new MultiPickedState<E>());
    GraphicsConfiguration config =
      SimpleUniverse.getPreferredConfiguration();
    final Canvas3D c = new Canvas3D(config);
    add(c, BorderLayout.CENTER);
    setPickedVertexState(new MultiPickedState<V>());
    setPickedEdgeState(new MultiPickedState<E>());

    // Create a SpringGraph scene and attach it to the virtual universe
View Full Code Here


/*      */
/*  347 */     if (userCanvases == null) {
/*  348 */       GraphicsConfiguration config = ConfiguredUniverse.getPreferredConfiguration();
/*      */
/*  351 */       this.canvases = new Canvas3D[1];
/*  352 */       this.canvases[0] = new Canvas3D(config);
/*      */       try {
/*  354 */         this.canvases[0].setFocusable(true); } catch (NoSuchMethodError e) {
/*      */       }
/*  356 */       createFramesAndPanels(setVisible);
/*      */     }
View Full Code Here

/*      */
/*  423 */     if (userCanvas == null) {
/*  424 */       GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
/*      */
/*  427 */       this.canvases = new Canvas3D[1];
/*  428 */       this.canvases[0] = new Canvas3D(config);
/*  429 */       createFramesAndPanels(true);
/*      */     }
/*      */     else {
/*  432 */       this.canvases = new Canvas3D[1];
/*  433 */       this.canvases[0] = userCanvas;
View Full Code Here

/* 2325 */     if (this.canvasInfo.length < this.canvasCount) {
/* 2326 */       this.canvasInfo = new CanvasInfo[this.canvasCount];
/*      */     }
/*      */
/* 2329 */     for (int i = 0; i < this.canvasCount; i++) {
/* 2330 */       Canvas3D c3d = this.view.getCanvas3D(i);
/* 2331 */       Screen3D s3d = c3d.getScreen3D();
/*      */
/* 2334 */       ScreenInfo si = (ScreenInfo)this.screenMap.get(s3d);
/* 2335 */       if (si == null) {
/* 2336 */         si = new ScreenInfo(s3d, c3d.getGraphicsConfiguration(), null);
/* 2337 */         this.screenMap.put(s3d, si);
/*      */       }
/*      */
/* 2343 */       if (this.newSet.add(si)) si.clear(this);
/*      */
View Full Code Here

   
   
   
    GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
   
    canvas3d = new Canvas3D(config);
    add(canvas3d, BorderLayout.CENTER);
   

   
   
View Full Code Here

    panel.setLayout(new BorderLayout());
 
    GraphicsConfiguration config =
        SimpleUniverse.getPreferredConfiguration();
    Canvas3D canvas = new Canvas3D(config);
    panel.add(BorderLayout.CENTER, canvas);
    SimpleUniverse universe = new SimpleUniverse(canvas);
    // This will move the ViewPlatform back a bit so the
    // objects in the scene can be viewed.
    universe.getViewingPlatform().setNominalViewingTransform();
View Full Code Here

    private BranchGroup root;

    private final Axis3DGroup axisGroup = new Axis3DGroup();

    public Universe3DPanel(Universe3D universe3D) {
        Canvas3D canvas3D = createGlobalGraphics();
        simpleU = new SimpleUniverse(canvas3D);
        viewTransform = simpleU.getViewingPlatform().getViewPlatformTransform();
        moveView();

        root = new BranchGroup();
View Full Code Here

    }

    private Canvas3D createGlobalGraphics() {
        setLayout(new BorderLayout());
        GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
        Canvas3D canvas3D = new Canvas3D(config);
        add("Center", canvas3D);
        return canvas3D;
    }
View Full Code Here

TOP

Related Classes of javax.media.j3d.Canvas3D

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.