Package sim.display3d

Class CapturingCanvas3D

java.lang.Object
java.awt.Component
java.awt.Canvas
javax.media.j3d.Canvas3D
sim.display3d.CapturingCanvas3D
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class CapturingCanvas3D extends javax.media.j3d.Canvas3D
Canvas3D that is synchronized with Display3D and uses postswap to save the contextGraphics into an image. You can wait() on the Canvas3D to be notified when a new image has arrived.

The original CapturingCanvas3D in the URL above is due to Peter Z. Kunszt at Johns Hopkins University. Our version borrows enough snippets and ideas from the original that due credit is definitely deserved.

See Also:
  • Constructor Details

  • Method Details

    • getLastImage

      public BufferedImage getLastImage()
    • beginCapturing

      public void beginCapturing(boolean movie)
      sets the capturing regime and area
    • stopCapturing

      public void stopCapturing()
    • postSwap

      public void postSwap()
      Overrides:
      postSwap in class javax.media.j3d.Canvas3D
    • postRender

      public void postRender()
      Overrides:
      postRender in class javax.media.j3d.Canvas3D