All Packages Class Hierarchy This Package Previous Next Index
Class java.media.j3d.GraphicsContext3D
java.lang.Object
|
+----java.media.j3d.GraphicsContext3D
- public class GraphicsContext3D
- extends Object
A GraphicsContext3D object is used for immediate mode rendering into
a 3D canvas. It is created by, and associated with, a specific
Canvas3D object. A GraphicsContext3D defines methods to set 3D graphics
state and draw 3D geometric primitives.
-
addLight(Light)
- Appends the specified light to this graphics context's list of lights.
-
addSound(Sound)
- Appends the specified sound to this graphics context's list of sounds.
-
clear()
- Clear the Canvas3D to the color or image specified by the
current background node.
-
draw(Geometry)
- Draw the specified Geometry component object.
-
draw(Shape3D)
- Draw the specified Shape3D leaf node object.
-
getAllLights()
- Retrieves the enumeration object of all the lights.
-
getAllSounds()
- Retrieves the enumeration object of all the sounds.
-
getAppearance()
- Retrieves the current Appearance component object.
-
getAuralAttributes()
- Retrieves the current AuralAttributes component object.
-
getBackground()
- Retrieves the current Background leaf node object.
-
getCanvas3D()
- Gets the Canvas3D that created this GraphicsContext3D.
-
getFog()
- Retrieves the current Fog leaf node object.
-
getHiRes(HiResCoord)
- Retrieves the current HiRes coordinate of this context.
-
getLight(int)
- Retrieves the index selected light.
-
getModelTransform(Transform3D)
- Retrieves the current model transform.
-
getSound(int)
- Retrieves the index selected sound.
-
insertLight(Light, int)
- Inserts the specified light at the specified index location.
-
insertSound(Sound, int)
- Inserts the specified sound at the specified index location.
-
isSoundPlaying(int)
- Retrieves the sound playing flag
-
multiplyModelTransform(Transform3D)
- Multiplies the current model transform by the specified
transform and stores the result back into the current
transform.
-
numLights()
- Retrieves the current number of lights in this graphics context.
-
numSounds()
- Retrieves the current number of sounds in this graphics context.
-
readRaster(Raster)
- Read an image from the frame buffer and copy it into the
PixelArray and/or DepthImage
objects referenced by the specified Raster object.
-
removeLight(int)
- Removes the light at the specified index location.
-
removeSound(int)
- Removes the sound at the specified index location.
-
setAppearance(Appearance)
- Sets the current Appearance object to the specified
Appearance component object.
-
setAuralAttributes(AuralAttributes)
- Sets the current AuralAttributes object to the specified
AuralAttributes component object.
-
setBackground(Background)
- Sets the current Background to the specified Background
leaf node object.
-
setFog(Fog)
- Sets the current Fog to the specified Fog
leaf node object.
-
setHiRes(HiResCoord)
- Sets the HiRes coordinate of this context
to the location specified by the HiRes argument.
-
setHiRes(int[], int[], int[])
- Sets the HiRes coordinate of this context to the location
specified by the parameters provided.
-
setLight(Light, int)
- Replaces the specified light with the light provided.
-
setModelTransform(Transform3D)
- Sets the current model transform to a copy of the specified
transform.
-
setSound(Sound, int)
- Replaces the specified sound with the sound provided.
getCanvas3D
public final Canvas3D getCanvas3D()
- Gets the Canvas3D that created this GraphicsContext3D.
- Returns:
- the Canvas3D that created this GraphicsContext3D
setAppearance
public final void setAppearance(Appearance appearance)
- Sets the current Appearance object to the specified
Appearance component object.
- Parameters:
- appearance - the new Appearance object
getAppearance
public final Appearance getAppearance()
- Retrieves the current Appearance component object.
- Returns:
- the current Appearance object
setBackground
public final void setBackground(Background background)
- Sets the current Background to the specified Background
leaf node object.
- Parameters:
- background - the new Background object
getBackground
public final Background getBackground()
- Retrieves the current Background leaf node object.
- Returns:
- the current Background object
setFog
public final void setFog(Fog fog)
- Sets the current Fog to the specified Fog
leaf node object.
- Parameters:
- fog - the new Fog object
getFog
public final Fog getFog()
- Retrieves the current Fog leaf node object.
- Returns:
- the current Fog object
setLight
public final void setLight(Light light,
int index)
- Replaces the specified light with the light provided.
- Parameters:
- light - the new light
- index - which light to replace
insertLight
public final void insertLight(Light light,
int index)
- Inserts the specified light at the specified index location.
- Parameters:
- light - the new light
- index - at which location to insert
removeLight
public final void removeLight(int index)
- Removes the light at the specified index location.
- Parameters:
- index - which light to remove
getLight
public final Light getLight(int index)
- Retrieves the index selected light.
- Parameters:
- index - which light to return
- Returns:
- the light at location index
getAllLights
public final Enumeration getAllLights()
- Retrieves the enumeration object of all the lights.
- Returns:
- the enumeration object of all the lights
addLight
public final void addLight(Light light)
- Appends the specified light to this graphics context's list of lights.
- Parameters:
- light - the light to add
numLights
public final int numLights()
- Retrieves the current number of lights in this graphics context.
- Returns:
- the current number of lights
setHiRes
public void setHiRes(int x[],
int y[],
int z[])
- Sets the HiRes coordinate of this context to the location
specified by the parameters provided.
- Parameters:
- x - an eight element array specifying the x position
- y - an eight element array specifying the y position
- z - an eight element array specifying the z position
setHiRes
public void setHiRes(HiResCoord hiRes)
- Sets the HiRes coordinate of this context
to the location specified by the HiRes argument.
- Parameters:
- hiRes - the HiRes coordinate specifying the a new location
getHiRes
public void getHiRes(HiResCoord hiRes)
- Retrieves the current HiRes coordinate of this context.
- Parameters:
- hiRes - a HiResCoord object that will receive the
HiRes coordinate of this context
setModelTransform
public void setModelTransform(Transform3D t)
- Sets the current model transform to a copy of the specified
transform.
NOTE: the current
definition of transform is broken in that a user cannot
get the matrix represented by the transform. This will be
fixed.
- Parameters:
- t - the new model transform
- Throws: BadTransformException
- if the transform is
not congruent (angle and length preserving).
multiplyModelTransform
public void multiplyModelTransform(Transform3D t)
- Multiplies the current model transform by the specified
transform and stores the result back into the current
transform.
- Parameters:
- t - the model transform to be concatenated with the
current model transform.
- Throws: BadTransformException
- if the transform is
not congruent (angle and length preserving).
getModelTransform
public void getModelTransform(Transform3D t)
- Retrieves the current model transform.
- Parameters:
- t - the model transform that will receive the current
model transform.
setSound
public final void setSound(Sound sound,
int index)
- Replaces the specified sound with the sound provided.
- Parameters:
- sound - the new sound
- index - which sound to replace
insertSound
public final void insertSound(Sound sound,
int index)
- Inserts the specified sound at the specified index location.
- Parameters:
- sound - the new sound
- index - at which location to insert
removeSound
public final void removeSound(int index)
- Removes the sound at the specified index location.
- Parameters:
- index - which sound to remove
getSound
public final Sound getSound(int index)
- Retrieves the index selected sound.
- Parameters:
- index - which sound to return
- Returns:
- the sound at location index
getAllSounds
public final Enumeration getAllSounds()
- Retrieves the enumeration object of all the sounds.
- Returns:
- the enumeration object of all the sounds
addSound
public final void addSound(Sound sound)
- Appends the specified sound to this graphics context's list of sounds.
- Parameters:
- sound - the sound to add
numSounds
public final int numSounds()
- Retrieves the current number of sounds in this graphics context.
- Returns:
- the current number of sounds
isSoundPlaying
public final boolean isSoundPlaying(int index)
- Retrieves the sound playing flag
- Returns:
- flag denoting if sound is currently playing
setAuralAttributes
public final void setAuralAttributes(AuralAttributes attributes)
- Sets the current AuralAttributes object to the specified
AuralAttributes component object.
- Parameters:
- attributes - the new AuralAttributes object
getAuralAttributes
public final AuralAttributes getAuralAttributes()
- Retrieves the current AuralAttributes component object.
- Returns:
- the current AuralAttributes object
clear
public final void clear()
- Clear the Canvas3D to the color or image specified by the
current background node.
draw
public final void draw(Geometry geometry)
- Draw the specified Geometry component object.
- Parameters:
- geometry - the Geometry object to draw.
draw
public final void draw(Shape3D shape)
- Draw the specified Shape3D leaf node object. This is
a convenience method that is identical to calling the
setAppearance(Appearance) and draw(Geometry) methods
passing the appearance and geometry component objects of
the specified shape node as arguments.
- Parameters:
- shape - the Shape3D node containing the Appearance component
object to set and Geometry component object to draw.
readRaster
public final void readRaster(Raster raster)
- Read an image from the frame buffer and copy it into the
PixelArray and/or DepthImage
objects referenced by the specified Raster object.
All parameters of the Raster object and the component PixelArray
and/or DepthImage objects must be set to the desired values
prior to calling this method. These values determine the location,
size, and format of the pixel data that is read.
- Parameters:
- raster - the Raster object used to read the
contents of the frame buffer.
All Packages Class Hierarchy This Package Previous Next Index