All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class javax.media.j3d.Canvas3D

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----javax.media.j3d.Canvas3D

public class Canvas3D
extends Canvas
The Canvas3D class provides a drawing canvas for 3D rendering. It is an extension of the AWT Canvas class that users may further subclass to implement additional functionality.


Variable Index

 o FIELD_ALL
Specifies a single-field rendering loop.
 o FIELD_LEFT
Specifies the left field of a field-sequential stereo rendering loop.
 o FIELD_RIGHT
Specifies the right field of a field-sequential stereo rendering loop.

Constructor Index

 o Canvas3D(GraphicsConfiguration)
Constructs and initializes a new Canvas3D object that Java 3D can render into.

Method Index

 o addNotify()
 o getCenterEyeInImagePlate(Point3d)
Retrieves the actual position of the center eye in image-plate coordinates and copies that value into the object provided.
 o getDoubleBufferAvailable()
Returns a status flag indicating whether or not double buffering is available.
 o getDoubleBufferEnable()
Returns a status flag indicating whether or not double buffering is enabled.
 o getGraphicsContext3D()
Get the immediate mode 3D graphics context associated with this Canvas3D.
 o getImagePlateToVworld(Transform3D)
Retrieves the current ImagePlate coordinates to Virtual World coordinates transform and places it into the specified object.
 o getLeftEyeInImagePlate(Point3d)
Retrieves the actual position of the left eye in image-plate coordinates and copies that value into the object provided.
 o getLeftManualEyeInImagePlate(Point3d)
Retrieves the position of the user-specified, manual left eye in image-plate coordinates and copies that value into the object provided.
 o getPhysicalHeight()
Retrieves the physical height of this canvas window in meters.
 o getPhysicalWidth()
Retrieves the physical width of this canvas window in meters.
 o getPixelLocationInImagePlate(int, int, Point3d)
Computes the position of the specified AWT pixel value in image-plate coordinates and copies that value into the object provided.
 o getRightEyeInImagePlate(Point3d)
Retrieves the actual position of the right eye in image-plate coordinates and copies that value into the object provided.
 o getRightManualEyeInImagePlate(Point3d)
Retrieves the position of the user-specified, manual right eye in image-plate coordinates and copies that value into the object provided.
 o getSceneAntialiasingAvailable()
Returns a status flag indicating whether or not scene antialiasing is available.
 o getScreen3D()
Retrieve the Screen3D object that this Canvas3D is attached to.
 o getStereoAvailable()
Returns a status flag indicating whether or not stereo is available.
 o getStereoEnable()
Returns a status flag indicating whether or not stereo is enabled.
 o getView()
Gets view that points to this Canvas3D.
 o getVworldToImagePlate(Transform3D)
Retrieves the current Virtual World coordinates to ImagePlate coordinates transform and places it into the specified object.
 o paint(Graphics)
This method overrides AWT's paint class...
 o postRender()
This routine is called by the Java 3D rendering loop after completing all rendering to the canvas for this frame and before the buffer swap.
 o postSwap()
This routine is called by the Java 3D rendering loop after completing all rendering to the canvas, and all other canvases associated with this view, for this frame following the buffer swap.
 o preRender()
This routine is called by the Java 3D rendering loop after clearing the canvas and before any rendering has been done for this frame.
 o processEvent(AWTEvent)
This method overrides AWT's handleEvent class...
 o renderField(int)
This routine is called by the Java 3D rendering loop during the execution of the rendering loop.
 o setDoubleBufferEnable(boolean)
Turns double buffering on or off.
 o setLeftManualEyeInImagePlate(Point3d)
Sets the position of the manual left eye in image-plate coordinates.
 o setRightManualEyeInImagePlate(Point3d)
Sets the position of the manual right eye in image-plate coordinates.
 o setStereoEnable(boolean)
Turns stereo on or off.
 o startRenderer()
Start the Java 3D renderer on this Canvas3D object.
 o stopRenderer()
Stop the Java 3D renderer on this Canvas3D object.
 o swap()
Synchronize and swap buffers on a double buffered canvas for this Canvas3D object.

Variables

 o FIELD_LEFT
 public static final int FIELD_LEFT
Specifies the left field of a field-sequential stereo rendering loop. A left field always precedes a right field.

 o FIELD_RIGHT
 public static final int FIELD_RIGHT
Specifies the right field of a field-sequential stereo rendering loop. A right field always follows a left field.

 o FIELD_ALL
 public static final int FIELD_ALL
Specifies a single-field rendering loop.

Constructors

 o Canvas3D
 public Canvas3D(GraphicsConfiguration graphicsConfiguration)
Constructs and initializes a new Canvas3D object that Java 3D can render into.

Parameters:
graphicsConfiguration - a valid GraphicsConfiguration object which will be used to create the canvas.
See Also:
GraphicsConfiguration

Methods

 o processEvent
 public void processEvent(AWTEvent evt)
This method overrides AWT's handleEvent class...

Overrides:
processEvent in class Component
 o paint
 public void paint(Graphics g)
This method overrides AWT's paint class...

Overrides:
paint in class Canvas
 o addNotify
 public void addNotify()
Overrides:
addNotify in class Canvas
 o getScreen3D
 public final Screen3D getScreen3D()
Retrieve the Screen3D object that this Canvas3D is attached to.

Returns:
the 3D screen object that this Canvas3D is attached to
 o getGraphicsContext3D
 public final GraphicsContext3D getGraphicsContext3D()
Get the immediate mode 3D graphics context associated with this Canvas3D. A new graphics context is created if one does not already exist. A new GraphicsContext3D initializes its state variables to the following defaults:

Returns:
a GraphicsContext3D object that can be used for immediate mode rendering to this Canvas3D.
 o preRender
 public void preRender()
This routine is called by the Java 3D rendering loop after clearing the canvas and before any rendering has been done for this frame. Applications that wish to perform operations in the rendering loop, prior to any actual rendering may override this function.

 o postRender
 public void postRender()
This routine is called by the Java 3D rendering loop after completing all rendering to the canvas for this frame and before the buffer swap. Applications that wish to perform operations in the rendering loop, following any actual rendering may override this function.

 o postSwap
 public void postSwap()
This routine is called by the Java 3D rendering loop after completing all rendering to the canvas, and all other canvases associated with this view, for this frame following the buffer swap. Applications that wish to perform operations at the very end of the rendering loop may override this function.

 o renderField
 public void renderField(int fieldDesc)
This routine is called by the Java 3D rendering loop during the execution of the rendering loop. It is called once for each field (i.e., once per frame on a mono system or once each for the right eye and left eye on a two-pass stereo system. This is intended for use by applications that want to mix retained/compiled-retained mode rendering with some immediate mode rendering. Applications that wish to perform operations during the rendering loop, may override this function.

Parameters:
fieldDesc - field description, one of: FIELD_LEFT, FIELD_RIGHT or FIELD_ALL. Applications that wish to work correctly in stereo mode should render the same image for both FIELD_LEFT and FIELD_RIGHT calls. If Java 3D calls the renderer with FIELD_ALL then the immediate mode rendering only needs to be done once.
 o stopRenderer
 public final void stopRenderer()
Stop the Java 3D renderer on this Canvas3D object. If the Java 3D renderer is currently running, the rendering will be synchronized before being stopped. No further rendering will be done to this canvas by Java 3D until the renderer is started again. In pure immediate mode this method should be called prior to adding this canvas to an active View object.

 o startRenderer
 public final void startRenderer()
Start the Java 3D renderer on this Canvas3D object. If the Java 3D renderer is not currently running, any rendering to other Canvas3D objects sharing the same View will be synchronized before this Canvas3D's renderer is (re)started. When a Canvas3D is created, it is initially marked as being started. This means that as soon as the Canvas3D is added to an active View object, the rendering loop will render the scene graph to the canvas.

 o swap
 public final void swap()
Synchronize and swap buffers on a double buffered canvas for this Canvas3D object. This method should only be called if the Java 3D renderer has been stopped. In the normal case, the renderer automatically swaps the buffer. If the Java 3D renderer is running for this canvas then a RestrictedAccessException exception is thrown.

Throws: RestrictedAccessException
when a call to swap() is made while the Java 3D renderer rendering is running.
See Also:
stopRenderer
 o setLeftManualEyeInImagePlate
 public final void setLeftManualEyeInImagePlate(Point3d position)
Sets the position of the manual left eye in image-plate coordinates. This value determines eye placement when a head tracker is not in use and the application is directly controlling the eye position in image-plate coordinates. In head-tracked mode or when the windowEyePointPolicy is RELATIVE_TO_FIELD_OF_VIEW, this value is ignored. When the windowEyepointPolicy is RELATIVE_TO_WINDOW only the Z value is used.

Parameters:
position - the new manual left eye position
 o setRightManualEyeInImagePlate
 public final void setRightManualEyeInImagePlate(Point3d position)
Sets the position of the manual right eye in image-plate coordinates. This value determines eye placement when a head tracker is not in use and the application is directly controlling the eye position in image-plate coordinates. In head-tracked mode or when the windowEyePointPolicy is RELATIVE_TO_FIELD_OF_VIEW, this value is ignored. When the windowEyepointPolicy is RELATIVE_TO_WINDOW only the Z value is used.

Parameters:
position - the new manual right eye position
 o getLeftManualEyeInImagePlate
 public final void getLeftManualEyeInImagePlate(Point3d position)
Retrieves the position of the user-specified, manual left eye in image-plate coordinates and copies that value into the object provided.

Parameters:
position - the object that will receive the position
 o getRightManualEyeInImagePlate
 public final void getRightManualEyeInImagePlate(Point3d position)
Retrieves the position of the user-specified, manual right eye in image-plate coordinates and copies that value into the object provided.

Parameters:
position - the object that will receive the position
 o getLeftEyeInImagePlate
 public final void getLeftEyeInImagePlate(Point3d position)
Retrieves the actual position of the left eye in image-plate coordinates and copies that value into the object provided. This value is a function of the windowEyepointPolicy, the tracking enable flag, and the manual left eye position.

Parameters:
position - the object that will receive the position
 o getRightEyeInImagePlate
 public final void getRightEyeInImagePlate(Point3d position)
Retrieves the actual position of the right eye in image-plate coordinates and copies that value into the object provided. This value is a function of the windowEyepointPolicy, the tracking enable flag, and the manual right eye position.

Parameters:
position - the object that will receive the position
 o getCenterEyeInImagePlate
 public final void getCenterEyeInImagePlate(Point3d position)
Retrieves the actual position of the center eye in image-plate coordinates and copies that value into the object provided. The center eye is the fictional eye half-way between the left and right eye. This value is a function of the windowEyepointPolicy, the tracking enable flag, and the manual right and left eye positions.

Parameters:
position - the object that will receive the position
See Also:
setMonoscopicViewPolicy
 o getImagePlateToVworld
 public final void getImagePlateToVworld(Transform3D t)
Retrieves the current ImagePlate coordinates to Virtual World coordinates transform and places it into the specified object.

Parameters:
t - the Transform3D object that will receive the transform
 o getPixelLocationInImagePlate
 public final void getPixelLocationInImagePlate(int x,
                                                int y,
                                                Point3d position)
Computes the position of the specified AWT pixel value in image-plate coordinates and copies that value into the object provided.

Parameters:
x - the X coordinate of the pixel relative to the upper-left hand corner of the window.
y - the Y coordinate of the pixel relative to the upper-left hand corner of the window.
position - the object that will receive the position in physical image plate coordinates (relative to the lower-left corner of the screen).
 o getPhysicalWidth
 public final double getPhysicalWidth()
Retrieves the physical width of this canvas window in meters.

Returns:
the physical window width in meters.
 o getPhysicalHeight
 public final double getPhysicalHeight()
Retrieves the physical height of this canvas window in meters.

Returns:
the physical window height in meters.
 o getVworldToImagePlate
 public final void getVworldToImagePlate(Transform3D t)
Retrieves the current Virtual World coordinates to ImagePlate coordinates transform and places it into the specified object.

Parameters:
t - the Transform3D object that will receive the transform
 o getView
 public final View getView()
Gets view that points to this Canvas3D.

Returns:
view object that points to this Canvas3D
 o getStereoAvailable
 public final boolean getStereoAvailable()
Returns a status flag indicating whether or not stereo is available.

Returns:
a flag indicating if stereo is available
 o setStereoEnable
 public final void setStereoEnable(boolean flag)
Turns stereo on or off.

Parameters:
flag - enabling the display of stereo
 o getStereoEnable
 public final boolean getStereoEnable()
Returns a status flag indicating whether or not stereo is enabled.

Returns:
a flag indicating if stereo is enabled
 o getDoubleBufferAvailable
 public final boolean getDoubleBufferAvailable()
Returns a status flag indicating whether or not double buffering is available.

Returns:
a flag indicating if double buffering is available.
 o setDoubleBufferEnable
 public final void setDoubleBufferEnable(boolean flag)
Turns double buffering on or off. If double buffering is off, all drawing is to the front buffer and no buffer swap is done between frames. It should be stressed that running Java 3D with double buffering disabled is not recommended.

Parameters:
flag - enabling or disabling double buffering.
 o getDoubleBufferEnable
 public final boolean getDoubleBufferEnable()
Returns a status flag indicating whether or not double buffering is enabled.

Returns:
a flag indicating if double buffering is enabled.
 o getSceneAntialiasingAvailable
 public final boolean getSceneAntialiasingAvailable()
Returns a status flag indicating whether or not scene antialiasing is available.

Returns:
a flag indicating if scene antialiasing is available.

All Packages  Class Hierarchy  This Package  Previous  Next  Index