All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.media.j3d.Canvas3D

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----java.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 CYCLOPEAN_EYE_VIEW
Specifies that monoscopic view generated should be the view as seen from the 'center eye', the fictional eye half-way between the left and right eye.
 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.
 o LEFT_EYE_VIEW
Specifies that monoscopic view generated should be the view as seen from the left eye.
 o PHYSICAL_WORLD
Policy for resizing and moving windows.
 o RELATIVE_TO_FIELD_OF_VIEW
Specifies that Java 3D should modify the position of the eye-point to match any changes in field of view; the view frustum will change whenever the application program changes the field of view.
 o RELATIVE_TO_SCREEN
Specifies that Java 3D should interpret the given fixed eye-point position as relative to the screen.
 o RELATIVE_TO_WINDOW
Specifies that Java 3D should interpret the given fixed-eye-point position as relative to the window; implying that the view frustum shape will change whenever a user moves the location of a window on the screen.
 o RIGHT_EYE_VIEW
Specifies that monoscopic view generated should be the view as seen from the right eye.
 o VIRTUAL_WORLD
Policy for resizing and moving windows.

Constructor Index

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

Method Index

 o addNotify()
 o getGraphicsContext3D()
Get the immediate mode 3D graphics context associated with this Canvas3D.
 o getMonoscopicViewPolicy()
Returns policy on how Java 3D generates monoscopic view.
 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 getWindowEyepointPolicy()
Returns the current window eye-point policy, one of: RELATIVE_TO_SCREEN, RELATIVE_TO_WINDOW, or RELATIVE_TO_FIELD_OF_VIEW.
 o getWindowMovementPolicy()
Returns the current window movement policy, one of: VIRTUAL_WORLD or PHYSICAL_WORLD.
 o getWindowResizePolicy()
Returns the current window resize policy, one of: VIRTUAL_WORLD or PHYSICAL_WORLD.
 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 loop.
 o setMonoscopicViewPolicy(int)
Specifies how Java 3D generates monoscopic view.
 o setStereoEnable(boolean)
Turns stereo on or off.
 o setWindowEyepointPolicy(int)
Sets the view model's window eye-point policy.
 o setWindowMovementPolicy(int)
Sets the window movement policy.
 o setWindowResizePolicy(int)
Sets the window resize policy.
 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 VIRTUAL_WORLD
 public static final int VIRTUAL_WORLD
Policy for resizing and moving windows. Used in specifying windowResizePolicy and windowMovementPolicy. VIRTUAL_WORLD specifies that the associated action takes place in the virtual world.

 o PHYSICAL_WORLD
 public static final int PHYSICAL_WORLD
Policy for resizing and moving windows. Used in specifying windowResizePolicy and windowMovementPolicy. PHYSICAL_WORLD specifies that the specified action takes place in the physical world.

 o RELATIVE_TO_SCREEN
 public static final int RELATIVE_TO_SCREEN
Specifies that Java 3D should interpret the given fixed eye-point position as relative to the screen. Policy for placing the eye-point in non-head-tracked modes. Used in specifying windowEyepointPolicy.

 o RELATIVE_TO_WINDOW
 public static final int RELATIVE_TO_WINDOW
Specifies that Java 3D should interpret the given fixed-eye-point position as relative to the window; implying that the view frustum shape will change whenever a user moves the location of a window on the screen. Policy for placing the eye-point in non-head-tracked modes. Used in specifying windowEyepointPolicy.

 o RELATIVE_TO_FIELD_OF_VIEW
 public static final int RELATIVE_TO_FIELD_OF_VIEW
Specifies that Java 3D should modify the position of the eye-point to match any changes in field of view; the view frustum will change whenever the application program changes the field of view. Policy for placing the eye-point in non-head-tracked modes. Used in specifying windowEyepointPolicy.

 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.

 o LEFT_EYE_VIEW
 public static final int LEFT_EYE_VIEW
Specifies that monoscopic view generated should be the view as seen from the left eye.

 o RIGHT_EYE_VIEW
 public static final int RIGHT_EYE_VIEW
Specifies that monoscopic view generated should be the view as seen from the right eye.

 o CYCLOPEAN_EYE_VIEW
 public static final int CYCLOPEAN_EYE_VIEW
Specifies that monoscopic view generated should be the view as seen from the 'center eye', the fictional eye half-way between the left and right eye.

Constructors

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

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.

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 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 an exception is thrown.

 o setWindowResizePolicy
 public final void setWindowResizePolicy(int policy)
Sets the window resize policy. This variable specifies how Java 3D modifies the view when users resize windows. The variable can contain one of VIRTUAL_WORLD or PHYSICAL_WORLD. A value of VIRTUAL_WORLD implies that the original image remains the same size on the screen but the user sees more or less of the virtual world depending on whether the window grew or shrank in size. A value of PHYSICAL_WORLD implies that the original image continues to fill the window in the same way using more or less pixels depending on whether the window grew or shrank in size.

Parameters:
policy - the new policy, one of VIRTUAL_WORLD or PHYSICAL_WORLD
 o getWindowResizePolicy
 public final int getWindowResizePolicy()
Returns the current window resize policy, one of: VIRTUAL_WORLD or PHYSICAL_WORLD.

Returns:
the current window resize policy
 o setWindowMovementPolicy
 public final void setWindowMovementPolicy(int policy)
Sets the window movement policy. This variable specifies what part of the virtual world Java 3D draws as a function of window placement on the screen. The variable can contain one of VIRTUAL_WORLD or PHYSICAL_WORLD. A value of VIRTUAL_WORLD implies that the image seen in the window changes as the position of the window shifts on the screen. (This mode acts as if the window were a window into the virtual world.) A value of PHYSICAL_WORLD implies that the image seen in the window remains the same no matter where the user positions the window on the screen. The policy determines whether the window exists in the virtual or the physical world.

Parameters:
policy - the new policy, one of VIRTUAL_WORLD or PHYSICAL_WORLD
 o getWindowMovementPolicy
 public final int getWindowMovementPolicy()
Returns the current window movement policy, one of: VIRTUAL_WORLD or PHYSICAL_WORLD.

Returns:
the current window movement policy
 o setWindowEyepointPolicy
 public final void setWindowEyepointPolicy(int policy)
Sets the view model's window eye-point policy. This variable specifies how Java 3D handles the predefined eye point in a non-head-tracked environment. The variable can contain one of:

Parameters:
policy - the new policy, one of RELATIVE_TO_SCREEN, RELATIVE_TO_WINDOW, or RELATIVE_TO_FIELD_OF_VIEW
 o getWindowEyepointPolicy
 public final int getWindowEyepointPolicy()
Returns the current window eye-point policy, one of: RELATIVE_TO_SCREEN, RELATIVE_TO_WINDOW, or RELATIVE_TO_FIELD_OF_VIEW.

Returns:
the current window eye-point policy
 o setMonoscopicViewPolicy
 public final void setMonoscopicViewPolicy(int policy)
Specifies how Java 3D generates monoscopic view. If set to LEFT_EYE_VIEW, the view generated corresponds to view as seen from the left eye. If set to RIGHT_EYE_VIEW, the view generated corresponds to the view as seen from the right eye. If set to CYCLOPEAN_EYE_VIEW, the view generated corresponds to the view as seen from the 'center eye', the fictional eye half-way between the left and right eye.

Parameters:
policy - one of LEFT_EYE_VIEW, RIGHT_EYE_VIEW or CYCLOPEAN_EYE_VIEW.
 o getMonoscopicViewPolicy
 public final int getMonoscopicViewPolicy()
Returns policy on how Java 3D generates monoscopic view. If returns LEFT_EYE_VIEW, the view generated corresponds to view as seen from the left eye. If returns RIGHT_EYE_VIEW, the view generated corresponds to the view as seen from the right eye. If returns CYCLOPEAN_EYE_VIEW, the view generated corresponds to the view as seen from the 'center eye', the fictional eye half-way between the left and right eye.

Returns:
policy one of LEFT_EYE_VIEW, RIGHT_EYE_VIEW or CYCLOPEAN_EYE_VIEW.
 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

All Packages  Class Hierarchy  This Package  Previous  Next  Index