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.
-
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.
-
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.
-
LEFT_EYE_VIEW
- Specifies that monoscopic view generated should be the view as seen
from the left eye.
-
PHYSICAL_WORLD
- Policy for resizing and moving windows.
-
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.
-
RELATIVE_TO_SCREEN
- Specifies that Java 3D should interpret the
given fixed eye-point position as relative to the screen.
-
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.
-
RIGHT_EYE_VIEW
- Specifies that monoscopic view generated should be the view as seen
from the right eye.
-
VIRTUAL_WORLD
- Policy for resizing and moving windows.
-
Canvas3D()
- Constructs and initializes a new Canvas3D object that Java 3D
can render into.
-
addNotify()
-
-
getGraphicsContext3D()
- Get the immediate mode 3D graphics context associated with
this Canvas3D.
-
getMonoscopicViewPolicy()
- Returns policy on how Java 3D generates monoscopic view.
-
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.
-
getWindowEyepointPolicy()
- Returns the current window eye-point policy, one of:
RELATIVE_TO_SCREEN, RELATIVE_TO_WINDOW, or RELATIVE_TO_FIELD_OF_VIEW.
-
getWindowMovementPolicy()
- Returns the current window movement policy,
one of: VIRTUAL_WORLD or PHYSICAL_WORLD.
-
getWindowResizePolicy()
- Returns the current window resize policy, one of:
VIRTUAL_WORLD or PHYSICAL_WORLD.
-
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
loop.
-
setMonoscopicViewPolicy(int)
- Specifies how Java 3D generates monoscopic view.
-
setStereoEnable(boolean)
- Turns stereo on or off.
-
setWindowEyepointPolicy(int)
- Sets the view model's window eye-point policy.
-
setWindowMovementPolicy(int)
- Sets the window movement policy.
-
setWindowResizePolicy(int)
- Sets the window resize policy.
-
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Canvas3D
public Canvas3D()
- Constructs and initializes a new Canvas3D object that Java 3D
can render into.
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.
- 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
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 an exception is thrown.
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
getWindowResizePolicy
public final int getWindowResizePolicy()
- Returns the current window resize policy, one of:
VIRTUAL_WORLD or PHYSICAL_WORLD.
- Returns:
- the current window resize policy
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
getWindowMovementPolicy
public final int getWindowMovementPolicy()
- Returns the current window movement policy,
one of: VIRTUAL_WORLD or PHYSICAL_WORLD.
- Returns:
- the current window movement policy
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:
- RELATIVE_TO_SCREEN, Java 3D should interpret the
given fixed-eye-point position as relative to the screen
- RELATIVE_TO_WINDOW, Java 3D should interpret the
given fixed-eye-point position as relative to the window (this
implies that the view frustum shape will change whenever a
user moves the location of a window on the screen)
- RELATIVE_TO_FIELD_OF_VIEW, 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)
- Parameters:
- policy - the new policy, one of RELATIVE_TO_SCREEN,
RELATIVE_TO_WINDOW, or RELATIVE_TO_FIELD_OF_VIEW
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
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.
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.
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
All Packages Class Hierarchy This Package Previous Next Index