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.


Method Index

 o addLight(Light)
Appends the specified light to this graphics context's list of lights.
 o addSound(Sound)
Appends the specified sound to this graphics context's list of sounds.
 o clear()
Clear the Canvas3D to the color or image specified by the current background node.
 o draw(Geometry)
Draw the specified Geometry component object.
 o draw(Shape3D)
Draw the specified Shape3D leaf node object.
 o getAllLights()
Retrieves the enumeration object of all the lights.
 o getAllSounds()
Retrieves the enumeration object of all the sounds.
 o getAppearance()
Retrieves the current Appearance component object.
 o getAuralAttributes()
Retrieves the current AuralAttributes component object.
 o getBackground()
Retrieves the current Background leaf node object.
 o getCanvas3D()
Gets the Canvas3D that created this GraphicsContext3D.
 o getFog()
Retrieves the current Fog leaf node object.
 o getHiRes(HiResCoord)
Retrieves the current HiRes coordinate of this context.
 o getLight(int)
Retrieves the index selected light.
 o getModelTransform(Transform3D)
Retrieves the current model transform.
 o getSound(int)
Retrieves the index selected sound.
 o insertLight(Light, int)
Inserts the specified light at the specified index location.
 o insertSound(Sound, int)
Inserts the specified sound at the specified index location.
 o isSoundPlaying(int)
Retrieves the sound playing flag
 o multiplyModelTransform(Transform3D)
Multiplies the current model transform by the specified transform and stores the result back into the current transform.
 o numLights()
Retrieves the current number of lights in this graphics context.
 o numSounds()
Retrieves the current number of sounds in this graphics context.
 o 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.
 o removeLight(int)
Removes the light at the specified index location.
 o removeSound(int)
Removes the sound at the specified index location.
 o setAppearance(Appearance)
Sets the current Appearance object to the specified Appearance component object.
 o setAuralAttributes(AuralAttributes)
Sets the current AuralAttributes object to the specified AuralAttributes component object.
 o setBackground(Background)
Sets the current Background to the specified Background leaf node object.
 o setFog(Fog)
Sets the current Fog to the specified Fog leaf node object.
 o setHiRes(HiResCoord)
Sets the HiRes coordinate of this context to the location specified by the HiRes argument.
 o setHiRes(int[], int[], int[])
Sets the HiRes coordinate of this context to the location specified by the parameters provided.
 o setLight(Light, int)
Replaces the specified light with the light provided.
 o setModelTransform(Transform3D)
Sets the current model transform to a copy of the specified transform.
 o setSound(Sound, int)
Replaces the specified sound with the sound provided.

Methods

 o getCanvas3D
 public final Canvas3D getCanvas3D()
Gets the Canvas3D that created this GraphicsContext3D.

Returns:
the Canvas3D that created this GraphicsContext3D
 o setAppearance
 public final void setAppearance(Appearance appearance)
Sets the current Appearance object to the specified Appearance component object.

Parameters:
appearance - the new Appearance object
 o getAppearance
 public final Appearance getAppearance()
Retrieves the current Appearance component object.

Returns:
the current Appearance object
 o setBackground
 public final void setBackground(Background background)
Sets the current Background to the specified Background leaf node object.

Parameters:
background - the new Background object
 o getBackground
 public final Background getBackground()
Retrieves the current Background leaf node object.

Returns:
the current Background object
 o setFog
 public final void setFog(Fog fog)
Sets the current Fog to the specified Fog leaf node object.

Parameters:
fog - the new Fog object
 o getFog
 public final Fog getFog()
Retrieves the current Fog leaf node object.

Returns:
the current Fog object
 o 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
 o 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
 o removeLight
 public final void removeLight(int index)
Removes the light at the specified index location.

Parameters:
index - which light to remove
 o getLight
 public final Light getLight(int index)
Retrieves the index selected light.

Parameters:
index - which light to return
Returns:
the light at location index
 o getAllLights
 public final Enumeration getAllLights()
Retrieves the enumeration object of all the lights.

Returns:
the enumeration object of all the lights
 o 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
 o numLights
 public final int numLights()
Retrieves the current number of lights in this graphics context.

Returns:
the current number of lights
 o 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
 o 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
 o 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
 o 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).
 o 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).
 o getModelTransform
 public void getModelTransform(Transform3D t)
Retrieves the current model transform.

Parameters:
t - the model transform that will receive the current model transform.
 o 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
 o 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
 o removeSound
 public final void removeSound(int index)
Removes the sound at the specified index location.

Parameters:
index - which sound to remove
 o getSound
 public final Sound getSound(int index)
Retrieves the index selected sound.

Parameters:
index - which sound to return
Returns:
the sound at location index
 o getAllSounds
 public final Enumeration getAllSounds()
Retrieves the enumeration object of all the sounds.

Returns:
the enumeration object of all the sounds
 o 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
 o numSounds
 public final int numSounds()
Retrieves the current number of sounds in this graphics context.

Returns:
the current number of sounds
 o isSoundPlaying
 public final boolean isSoundPlaying(int index)
Retrieves the sound playing flag

Returns:
flag denoting if sound is currently playing
 o setAuralAttributes
 public final void setAuralAttributes(AuralAttributes attributes)
Sets the current AuralAttributes object to the specified AuralAttributes component object.

Parameters:
attributes - the new AuralAttributes object
 o getAuralAttributes
 public final AuralAttributes getAuralAttributes()
Retrieves the current AuralAttributes component object.

Returns:
the current AuralAttributes object
 o clear
 public final void clear()
Clear the Canvas3D to the color or image specified by the current background node.

 o draw
 public final void draw(Geometry geometry)
Draw the specified Geometry component object.

Parameters:
geometry - the Geometry object to draw.
 o 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.
 o 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