|
j3d.org Aviatrix3D | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.j3d.aviatrix3d.SceneGraphObject
org.j3d.aviatrix3d.Node
org.j3d.aviatrix3d.Leaf
org.j3d.aviatrix3d.Background
org.j3d.aviatrix3d.SphereBackground
Background node that renders a single user-provided texture on a sphere.
The background geometry is created internally to be a sphere. The user's texture is applied to the sphere such that the seam is located in the direction of the +Z axis (ie behind the viewer from the default view direction along the -Z axis). The top of the texture image is located at the +Y direction. If the texture contains some transparent section(s) then the clear colour can be used as well.
Note that this will take any 2D texture component as the source. However, if that image defines mipmapping, the background ignores it. Only the first (primary) image is used to render the texture.
This will set the background colour to a single colour for the entire
viewport. If used, this will override the setClearColor() on
DrawableSurface
.
Field Summary | |
protected int |
height
The height of the main texture. |
protected boolean |
stateChanged
Flag to say that the display lists must be cleared and regenerated because some state changed |
protected java.util.HashMap |
textureIdMap
The mapping of GL context to OpenGL texture ID |
protected int |
width
The width of the main texture. |
Fields inherited from class org.j3d.aviatrix3d.Background |
dispListMap |
Fields inherited from class org.j3d.aviatrix3d.Node |
bounds, implicitBounds, INVALID_BOUNDS, parent |
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject |
alive, updateHandler, WRITE_TIMING_MSG |
Constructor Summary | |
SphereBackground()
Constructs a background node for a base colour of black. |
|
SphereBackground(float[] c)
Construct a background node for a user-provided colour |
Method Summary | |
void |
cleanup(net.java.games.jogl.GL gl,
net.java.games.jogl.GLU glu)
Cleanup the object now for the given GL context. |
void |
getColor(float[] c)
Get the current drawing colour |
TextureComponent2D |
getTexture()
Get the current image that is being used on the background. |
protected void |
markBoundsDirty()
Mark this node as having dirty bounds due to one of it's children having their bounds changed. |
void |
postRender(net.java.games.jogl.GL gl,
net.java.games.jogl.GLU glu)
Restore all openGL state to the given drawable. |
void |
render(net.java.games.jogl.GL gl,
net.java.games.jogl.GLU glu)
Issue ogl commands needed for this component |
void |
setColor(float[] c)
Change the colour to the new colour. |
void |
setColor(float r,
float g,
float b,
float a)
Change the colour to the new colour. |
void |
setTexture(TextureComponent2D srcImage)
Set the image source to be used for the background. |
Methods inherited from class org.j3d.aviatrix3d.Node |
boundsChanged, checkForCyclicParent, getBounds, getParent, recomputeBounds, removeParent, setBounds, setLive, setParent, updateBounds |
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject |
checkForCyclicChild, dataChanged, getUserData, isLive, setUpdateHandler, setUserData |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected int width
protected int height
protected boolean stateChanged
protected java.util.HashMap textureIdMap
Constructor Detail |
public SphereBackground()
public SphereBackground(float[] c)
Method Detail |
public void cleanup(net.java.games.jogl.GL gl, net.java.games.jogl.GLU glu)
cleanup
in interface DeletableSceneGraphObject
gl
- The gl context to draw withglu
- The utility context to draw withpublic void render(net.java.games.jogl.GL gl, net.java.games.jogl.GLU glu)
render
in class Node
gl
- The gl context to draw withglu
- The utility context to draw withpublic void postRender(net.java.games.jogl.GL gl, net.java.games.jogl.GLU glu)
postRender
in class Node
gl
- The gl context to draw withglu
- The utility context to draw withprotected void markBoundsDirty()
markBoundsDirty
in class Node
public void setColor(float[] c) throws InvalidWriteTimingException
c
- The colour to copy in
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener callback methodpublic void setColor(float r, float g, float b, float a) throws InvalidWriteTimingException
r
- The red colour component to useg
- The green colour component to useb
- The blue colour component to usea
- The alpha colour component to use
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener callback methodpublic void getColor(float[] c)
c
- An array of length 4 or more to copy the colour topublic void setTexture(TextureComponent2D srcImage) throws InvalidWriteTimingException
srcImage
- The image data to use
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener callback methodpublic TextureComponent2D getTexture()
|
j3d.org Aviatrix3D | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |