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.
-
FIELD_ALL
- Specifies a single-field rendering loop.
-
FIELD_LEFT
- Specifies the left field of a field-sequential stereo rendering loop.
-
FIELD_RIGHT
- Specifies the right field of a field-sequential stereo rendering loop.
-
Canvas3D(GraphicsConfiguration)
- Constructs and initializes a new Canvas3D object that Java 3D
can render into.
-
addNotify()
-
-
getCenterEyeInImagePlate(Point3d)
- Retrieves the actual position of the center eye
in image-plate
coordinates and copies that value into the object provided.
-
getDoubleBufferAvailable()
- Returns a status flag indicating whether or not double
buffering is available.
-
getDoubleBufferEnable()
- Returns a status flag indicating whether or not double
buffering is enabled.
-
getGraphicsContext3D()
- Get the immediate mode 3D graphics context associated with
this Canvas3D.
-
getImagePlateToVworld(Transform3D)
- Retrieves the current ImagePlate coordinates to Virtual World
coordinates transform and places it into the specified object.
-
getLeftEyeInImagePlate(Point3d)
- Retrieves the actual position of the left eye
in image-plate
coordinates and copies that value into the object provided.
-
getLeftManualEyeInImagePlate(Point3d)
- Retrieves the position of the user-specified, manual left eye
in image-plate
coordinates and copies that value into the object provided.
-
getPhysicalHeight()
- Retrieves the physical height of this canvas window in meters.
-
getPhysicalWidth()
- Retrieves the physical width of this canvas window in meters.
-
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.
-
getRightEyeInImagePlate(Point3d)
- Retrieves the actual position of the right eye
in image-plate
coordinates and copies that value into the object provided.
-
getRightManualEyeInImagePlate(Point3d)
- Retrieves the position of the user-specified, manual right eye
in image-plate
coordinates and copies that value into the object provided.
-
getSceneAntialiasingAvailable()
- Returns a status flag indicating whether or not scene
antialiasing is available.
-
getScreen3D()
- Retrieve the Screen3D object that this Canvas3D is attached to.
-
getStereoAvailable()
- Returns a status flag indicating whether or not stereo
is available.
-
getStereoEnable()
- Returns a status flag indicating whether or not stereo
is enabled.
-
getView()
- Gets view that points to this Canvas3D.
-
getVworldToImagePlate(Transform3D)
- Retrieves the current Virtual World coordinates to ImagePlate
coordinates transform and places it into the specified object.
-
paint(Graphics)
- This method overrides AWT's paint class...
-
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.
-
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.
-
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.
-
processEvent(AWTEvent)
- This method overrides AWT's handleEvent class...
-
renderField(int)
- This routine is called by the Java 3D rendering loop during the
execution of the rendering loop.
-
setDoubleBufferEnable(boolean)
- Turns double buffering on or off.
-
setLeftManualEyeInImagePlate(Point3d)
- Sets the position of the manual left eye in image-plate
coordinates.
-
setRightManualEyeInImagePlate(Point3d)
- Sets the position of the manual right eye in image-plate
coordinates.
-
setStereoEnable(boolean)
- Turns stereo on or off.
-
startRenderer()
- Start the Java 3D renderer on this Canvas3D object.
-
stopRenderer()
- Stop the Java 3D renderer on this Canvas3D object.
-
swap()
- Synchronize and swap buffers on a double buffered canvas for
this Canvas3D object.
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.
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.
FIELD_ALL
public static final int FIELD_ALL
- Specifies a single-field rendering loop.
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
processEvent
public void processEvent(AWTEvent evt)
- This method overrides AWT's handleEvent class...
- Overrides:
- processEvent in class Component
paint
public void paint(Graphics g)
- This method overrides AWT's paint class...
- Overrides:
- paint in class Canvas
addNotify
public void addNotify()
- Overrides:
- addNotify in class Canvas
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
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:
- Background object: null
- Fog object: null
- Appearance object: null
- List of Light objects: empty
- high-res coordinate: (0, 0, 0)
- modelTransform: identity
- AuralAttributes object: null
- List of Sound objects: empty
- Returns:
- a GraphicsContext3D object that can be used for immediate
mode rendering to this Canvas3D.
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.
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.
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.
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.
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.
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.
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
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
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
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
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
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
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
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
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
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).
getPhysicalWidth
public final double getPhysicalWidth()
- Retrieves the physical width of this canvas window in meters.
- Returns:
- the physical window width in meters.
getPhysicalHeight
public final double getPhysicalHeight()
- Retrieves the physical height of this canvas window in meters.
- Returns:
- the physical window height in meters.
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
getView
public final View getView()
- Gets view that points to this Canvas3D.
- Returns:
- view object that points to this Canvas3D
getStereoAvailable
public final boolean getStereoAvailable()
- Returns a status flag indicating whether or not stereo
is available.
- Returns:
- a flag indicating if stereo is available
setStereoEnable
public final void setStereoEnable(boolean flag)
- Turns stereo on or off.
- Parameters:
- flag - enabling the display of stereo
getStereoEnable
public final boolean getStereoEnable()
- Returns a status flag indicating whether or not stereo
is enabled.
- Returns:
- a flag indicating if stereo is enabled
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.
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.
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.
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