|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.media.j3d.GraphicsContext3D
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. There are no public constructors of GraphicsContext3D. An application obtains a 3D graphics context object from the Canvas3D object that the application wishes to render into by using the getGraphicsContext3D method. A new graphics context is created if one does not already exist. A new GraphicsContext3D initializes its state variables to the following defaults:
Canvas3D.getGraphicsContext3D()
Method Summary | |
void |
addLight(Light light)
Appends the specified light to this graphics context's list of lights. |
void |
addSound(Sound sound)
Appends the specified sound to this graphics context's list of sounds. |
void |
clear()
Clear the Canvas3D to the color or image specified by the current background node. |
void |
draw(Geometry geometry)
Draw the specified Geometry component object. |
void |
draw(Shape3D shape)
Draw the specified Shape3D leaf node object. |
java.util.Enumeration |
getAllLights()
Retrieves the enumeration object of all the lights. |
java.util.Enumeration |
getAllSounds()
Retrieves the enumeration object of all the sounds. |
Appearance |
getAppearance()
Retrieves the current Appearance component object. |
AuralAttributes |
getAuralAttributes()
Retrieves the current AuralAttributes component object. |
Background |
getBackground()
Retrieves the current Background leaf node object. |
Canvas3D |
getCanvas3D()
Gets the Canvas3D that created this GraphicsContext3D. |
Fog |
getFog()
Retrieves the current Fog leaf node object. |
void |
getHiRes(HiResCoord hiRes)
Retrieves the current HiRes coordinate of this context. |
Light |
getLight(int index)
Retrieves the index selected light. |
void |
getModelTransform(Transform3D t)
Retrieves the current model transform. |
Sound |
getSound(int index)
Retrieves the index selected sound. |
void |
insertLight(Light light,
int index)
Inserts the specified light at the specified index location. |
void |
insertSound(Sound sound,
int index)
Inserts the specified sound at the specified index location. |
boolean |
isSoundPlaying(int index)
Retrieves the sound playing flag |
void |
multiplyModelTransform(Transform3D t)
Multiplies the current model transform by the specified transform and stores the result back into the current transform. |
int |
numLights()
Retrieves the current number of lights in this graphics context. |
int |
numSounds()
Retrieves the current number of sounds in this graphics context. |
void |
readRaster(Raster raster)
Read an image from the frame buffer and copy it into the ImageComponent and/or DepthComponent objects referenced by the specified Raster object. |
void |
removeLight(int index)
Removes the light at the specified index location. |
void |
removeSound(int index)
Removes the sound at the specified index location. |
void |
setAppearance(Appearance appearance)
Sets the current Appearance object to the specified Appearance component object. |
void |
setAuralAttributes(AuralAttributes attributes)
Sets the current AuralAttributes object to the specified AuralAttributes component object. |
void |
setBackground(Background background)
Sets the current Background to the specified Background leaf node object. |
void |
setFog(Fog fog)
Sets the current Fog to the specified Fog leaf node object. |
void |
setHiRes(HiResCoord hiRes)
Sets the HiRes coordinate of this context to the location specified by the HiRes argument. |
void |
setHiRes(int[] x,
int[] y,
int[] z)
Sets the HiRes coordinate of this context to the location specified by the parameters provided. |
void |
setLight(Light light,
int index)
Replaces the specified light with the light provided. |
void |
setModelTransform(Transform3D t)
Sets the current model transform to a copy of the specified transform. |
void |
setSound(Sound sound,
int index)
Replaces the specified sound with the sound provided. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Method Detail |
public final Canvas3D getCanvas3D()
public final void setAppearance(Appearance appearance)
appearance
- the new Appearance objectpublic final Appearance getAppearance()
public final void setBackground(Background background)
background
- the new Background objectpublic final Background getBackground()
public final void setFog(Fog fog)
fog
- the new Fog objectpublic final Fog getFog()
public final void setLight(Light light, int index)
light
- the new lightindex
- which light to replacepublic final void insertLight(Light light, int index)
light
- the new lightindex
- at which location to insertpublic final void removeLight(int index)
index
- which light to removepublic final Light getLight(int index)
index
- which light to returnpublic final java.util.Enumeration getAllLights()
public final void addLight(Light light)
light
- the light to addpublic final int numLights()
public void setHiRes(int[] x, int[] y, int[] z)
x
- an eight element array specifying the x positiony
- an eight element array specifying the y positionz
- an eight element array specifying the z positionHiResCoord
public void setHiRes(HiResCoord hiRes)
hiRes
- the HiRes coordinate specifying the a new locationpublic void getHiRes(HiResCoord hiRes)
hiRes
- a HiResCoord object that will receive the
HiRes coordinate of this contextpublic void setModelTransform(Transform3D t)
t
- the new model transformpublic void multiplyModelTransform(Transform3D t)
t
- the model transform to be concatenated with the
current model transform.public void getModelTransform(Transform3D t)
t
- the model transform that will receive the current
model transform.public final void setSound(Sound sound, int index)
sound
- the new soundindex
- which sound to replacepublic final void insertSound(Sound sound, int index)
sound
- the new soundindex
- at which location to insertpublic final void removeSound(int index)
index
- which sound to removepublic final Sound getSound(int index)
index
- which sound to returnpublic final java.util.Enumeration getAllSounds()
public final void addSound(Sound sound)
sound
- the sound to addpublic final int numSounds()
public final boolean isSoundPlaying(int index)
public final void setAuralAttributes(AuralAttributes attributes)
attributes
- the new AuralAttributes objectpublic final AuralAttributes getAuralAttributes()
public final void clear()
public final void draw(Geometry geometry)
geometry
- the Geometry object to draw.public final void draw(Shape3D shape)
shape
- the Shape3D node containing the Appearance component
object to set and Geometry component object to draw.public final void readRaster(Raster raster)
raster
- the Raster object used to read the
contents of the frame buffer.ImageComponent
,
DepthComponent
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |