Class dnx.ice.Graphics3D
All Packages Class Hierarchy This Package Previous Next Index
Class dnx.ice.Graphics3D
java.lang.Object
|
+----dnx.ice.Graphics3D
- public class Graphics3D
- extends Object
A Graphics3D object encapsulates a framebuffer and state used in 3D rendering.
It is a fairly low-level interface to whatever native 3D graphics system
a platform provides.
-
ACCUMULATION_BUFFER
-
-
ACCURATE_FOG
-
-
ACCURATE_SPECULAR
-
-
ALPHA_BLENDING
- Renderer features
-
AMBIENT_COLOR
-
-
ANTIALIASING
-
-
BUFFER_OFF
- Depth buffer access modes
-
BUFFER_READ_ONLY
-
-
BUFFER_READ_WRITE
-
-
BUFFER_WRITE_ONLY
-
-
COLOR_BUFFER
- Graphics3D buffers
-
COPY_BLEND
- Texture blending modes
-
DECAL_ALPHA_BLEND
-
-
DECAL_BLEND
-
-
DEPTH_BUFFER
-
-
DIFFUSE_COLOR
-
-
DITHERING
-
-
EMISSIVE_COLOR
-
-
FLAT_SHADE
- Shading modes
-
GOURAUD_SHADE
-
-
LINEAR
-
-
LINEAR_MIPMAP_LINEAR
-
-
LINEAR_MIPMAP_NEAREST
-
-
MIPMAP_LINEAR
-
-
MIPMAP_NEAREST
-
-
MODULATED_ALPHA_BLEND
-
-
MODULATED_BLEND
-
-
NEAREST
- Texture filtering modes
-
PHONG_SHADE
-
-
platform
-
-
SCREENDOOR_ALPHA
-
-
SPECULAR_COLOR
-
-
TEXTURE_PERSPECTIVE
-
-
TEXTURES
-
-
Graphics3D(Graphics3DDevice)
- Create a new 3D graphics context from a Graphics object.
-
accumLoad(float)
- Similar to accumulate, except that the values in the accumulation
buffer are replaced with the contents of the color buffer
multiplied by value.
-
accumMult(float)
- Multiply the contents of the accumulation buffer by value.
-
accumReturn(float)
- Multiply the contents of the accumulation buffer by value and
load them into the color buffer.
-
accumulate(float)
- Multiply the contents of the color buffer by value and add
to the accumulation buffer.
-
beginRendering()
- beginRendering must be called before rendering models.
-
clear(int)
- Clear one or more buffers; the buffers parameter
specifies which buffers will be cleared.
-
concatModelMatrix(Matrix4)
- Push the product of a matrix and the current model matrix onto the stack
-
copyBuffers(Graphics3D, int)
- Copy buffers from one viewport to another.
-
copyRect(Rectangle, int, int)
-
-
disableBackfaceCulling()
- Disable back face culling.
-
disableFeature(int)
-
-
disableTwoSidedLighting()
- Disable two-sided lighting.
-
drawImage()
-
-
drawRect(Rectangle, Color)
-
-
drawRect(Rectangle, Color, float)
-
-
enableBackfaceCulling()
- Enable back face culling.
-
enableFeature(int)
-
-
enableTwoSidedLighting()
- Enable two-sided lighting calculations.
-
endRendering()
- endRendering must be called after all models have been rendered
and before paint is called.
-
getDevice()
-
-
getModelMatrix(Matrix4)
- Load the current model matrix into m.
-
getPixelAspectRatio()
-
-
getTextureMatrix(Matrix4)
- Load the current texture matrix into m.
-
loadModelMatrix(Matrix4)
- Push a transformation onto the model matrix stack.
-
loadTextureMatrix(Matrix4)
- Push a transformation onto the texture transformation stack.
-
location()
-
-
paint(Graphics, int, int)
-
-
popLight()
- Remove the top light off the light stack.
-
popModelMatrix()
- Pop a transformation off the model transformation stack.
-
pushLight(Light)
- Push a light onto the light stack.
-
rayPick(Model, Ray3, PickResult)
-
-
render(Model)
- Render a model
-
resetLights()
- Remove all lights from the stack.
-
resetModelMatrix()
- Pop all model transformations off the stack and set the current
model transformation to the identity.
-
resize(Dimension)
- Resize to the specified dimension
-
resize(int, int)
- Resize to the specified height and width
-
rotateModel(float, float, float, float)
- Rotate the model by angle radians about the axis [ ax, ay, az]
-
rotateModel(Quaternion)
-
-
scaleModel(float)
- Scale the model uniformly on all axes
-
scaleModel(float, float, float)
- Scale the model
-
setClearColor(Color)
- Set the color to which the color buffer will be cleared when the clear
method is invoked.
-
setClearDepth(float)
- Set the depth to which the depth buffer will be cleared when the clear
method is invoked.
-
setColorBufferMask(int)
-
-
setDepthBufferMask(int)
- Enable or disable reading from or writing to the depth buffer.
-
setFog(Fog)
- Set the type of fog (i.e.
-
setMaterial(Material)
- Set the surface material for a model.
-
setModelRenderMode(int)
-
-
setModifiedMaterialColor(int)
- Set the material component which will be modified by
per-vertex and per-face colors in models.
-
setPixelAspectRatio(float)
-
-
setProjection(Projection)
- Set the camera projection
-
setShadeMode(int)
- Set the shade mode.
-
setTextureBlendMode(int)
-
-
setTextureCoordinateGeneration(TextureCoordinateGenerator)
- Set the method used to generate texture coordinates
-
setTextureFilter(int)
-
-
setTextureWrapping(boolean, boolean)
-
-
size()
- Return the dimensions
-
translateModel(float, float, float)
- Translate the model
-
useTexture(Texture)
- Set the texture that will be applied to models; if the texture is
null, no textures will be applied.
COLOR_BUFFER
public final static int COLOR_BUFFER
- Graphics3D buffers
DEPTH_BUFFER
public final static int DEPTH_BUFFER
ACCUMULATION_BUFFER
public final static int ACCUMULATION_BUFFER
BUFFER_OFF
public final static int BUFFER_OFF
- Depth buffer access modes
BUFFER_READ_ONLY
public final static int BUFFER_READ_ONLY
BUFFER_WRITE_ONLY
public final static int BUFFER_WRITE_ONLY
BUFFER_READ_WRITE
public final static int BUFFER_READ_WRITE
FLAT_SHADE
public final static int FLAT_SHADE
- Shading modes
GOURAUD_SHADE
public final static int GOURAUD_SHADE
PHONG_SHADE
public final static int PHONG_SHADE
ALPHA_BLENDING
public final static int ALPHA_BLENDING
- Renderer features
TEXTURES
public final static int TEXTURES
TEXTURE_PERSPECTIVE
public final static int TEXTURE_PERSPECTIVE
ANTIALIASING
public final static int ANTIALIASING
DITHERING
public final static int DITHERING
SCREENDOOR_ALPHA
public final static int SCREENDOOR_ALPHA
ACCURATE_FOG
public final static int ACCURATE_FOG
ACCURATE_SPECULAR
public final static int ACCURATE_SPECULAR
NEAREST
public final static int NEAREST
- Texture filtering modes
LINEAR
public final static int LINEAR
MIPMAP_NEAREST
public final static int MIPMAP_NEAREST
MIPMAP_LINEAR
public final static int MIPMAP_LINEAR
LINEAR_MIPMAP_NEAREST
public final static int LINEAR_MIPMAP_NEAREST
LINEAR_MIPMAP_LINEAR
public final static int LINEAR_MIPMAP_LINEAR
COPY_BLEND
public final static int COPY_BLEND
- Texture blending modes
DECAL_BLEND
public final static int DECAL_BLEND
MODULATED_BLEND
public final static int MODULATED_BLEND
DECAL_ALPHA_BLEND
public final static int DECAL_ALPHA_BLEND
MODULATED_ALPHA_BLEND
public final static int MODULATED_ALPHA_BLEND
EMISSIVE_COLOR
public final static int EMISSIVE_COLOR
AMBIENT_COLOR
public final static int AMBIENT_COLOR
DIFFUSE_COLOR
public final static int DIFFUSE_COLOR
SPECULAR_COLOR
public final static int SPECULAR_COLOR
platform
protected PlatformSpecific platform
Graphics3D
public Graphics3D(Graphics3DDevice device)
- Create a new 3D graphics context from a Graphics object.
The color model is the 'natural' color model of the window
server.
getDevice
public Graphics3DDevice getDevice()
paint
public abstract void paint(Graphics g,
int x,
int y)
beginRendering
public abstract void beginRendering()
- beginRendering must be called before rendering models.
endRendering
public abstract void endRendering()
- endRendering must be called after all models have been rendered
and before paint is called.
render
public abstract void render(Model m)
- Render a model
rayPick
public abstract boolean rayPick(Model m,
Ray3 ray,
PickResult result)
size
public abstract Dimension size()
- Return the dimensions
location
public abstract Point location()
resize
public abstract void resize(Dimension d)
- Resize to the specified dimension
resize
public abstract void resize(int width,
int height)
- Resize to the specified height and width
concatModelMatrix
public abstract void concatModelMatrix(Matrix4 m)
- Push the product of a matrix and the current model matrix onto the stack
loadModelMatrix
public abstract void loadModelMatrix(Matrix4 m)
- Push a transformation onto the model matrix stack.
popModelMatrix
public abstract void popModelMatrix()
- Pop a transformation off the model transformation stack.
translateModel
public abstract void translateModel(float tx,
float ty,
float tz)
- Translate the model
scaleModel
public abstract void scaleModel(float sx,
float sy,
float sz)
- Scale the model
scaleModel
public abstract void scaleModel(float s)
- Scale the model uniformly on all axes
rotateModel
public abstract void rotateModel(float ax,
float ay,
float az,
float angle)
- Rotate the model by angle radians about the axis [ ax, ay, az]
rotateModel
public abstract void rotateModel(Quaternion q)
resetModelMatrix
public abstract void resetModelMatrix()
- Pop all model transformations off the stack and set the current
model transformation to the identity.
loadTextureMatrix
public abstract void loadTextureMatrix(Matrix4 m)
- Push a transformation onto the texture transformation stack.
getModelMatrix
public abstract void getModelMatrix(Matrix4 m)
- Load the current model matrix into m.
getTextureMatrix
public abstract void getTextureMatrix(Matrix4 m)
- Load the current texture matrix into m.
getPixelAspectRatio
public float getPixelAspectRatio()
setPixelAspectRatio
public void setPixelAspectRatio(float ratio)
setModelRenderMode
public abstract void setModelRenderMode(int renderMode)
setProjection
public abstract void setProjection(Projection p)
- Set the camera projection
setMaterial
public abstract void setMaterial(Material m)
- Set the surface material for a model.
setModifiedMaterialColor
public abstract void setModifiedMaterialColor(int color)
- Set the material component which will be modified by
per-vertex and per-face colors in models.
pushLight
public abstract void pushLight(Light l)
- Push a light onto the light stack.
- See Also:
- DirectionalLight, PointLight, SpotLight
popLight
public abstract void popLight()
- Remove the top light off the light stack.
resetLights
public abstract void resetLights()
- Remove all lights from the stack.
setFog
public abstract void setFog(Fog f)
- Set the type of fog (i.e. how colors are attenuated as distance from
the viewer increases.) If the argument is null, fog is turned off.
setShadeMode
public abstract void setShadeMode(int shadeMode)
- Set the shade mode.
enableFeature
public abstract void enableFeature(int feature)
disableFeature
public abstract void disableFeature(int feature)
setTextureBlendMode
public abstract void setTextureBlendMode(int blendMode)
setTextureWrapping
public abstract void setTextureWrapping(boolean wrapU,
boolean wrapV)
setTextureFilter
public abstract void setTextureFilter(int filter)
setTextureCoordinateGeneration
public abstract void setTextureCoordinateGeneration(TextureCoordinateGenerator gen)
- Set the method used to generate texture coordinates
useTexture
public abstract void useTexture(Texture t)
- Set the texture that will be applied to models; if the texture is
null, no textures will be applied.
setDepthBufferMask
public abstract void setDepthBufferMask(int mask)
- Enable or disable reading from or writing to the depth buffer. This
has no effect if a graphics context has no depth buffer.
setColorBufferMask
public abstract void setColorBufferMask(int mask)
drawRect
public abstract void drawRect(Rectangle r,
Color c)
drawRect
public abstract void drawRect(Rectangle r,
Color c,
float opacity)
copyRect
public abstract void copyRect(Rectangle src,
int x,
int y)
drawImage
public abstract void drawImage()
copyBuffers
public abstract void copyBuffers(Graphics3D g,
int buffers)
- Copy buffers from one viewport to another.
setClearColor
public abstract void setClearColor(Color c)
- Set the color to which the color buffer will be cleared when the clear
method is invoked.
setClearDepth
public abstract void setClearDepth(float depth)
- Set the depth to which the depth buffer will be cleared when the clear
method is invoked.
clear
public abstract void clear(int buffers)
- Clear one or more buffers; the buffers parameter
specifies which buffers will be cleared.
enableTwoSidedLighting
public abstract void enableTwoSidedLighting()
- Enable two-sided lighting calculations. Surface normals of back
facing polygons will be inverted for lighting calculations.
disableTwoSidedLighting
public abstract void disableTwoSidedLighting()
- Disable two-sided lighting.
enableBackfaceCulling
public abstract void enableBackfaceCulling()
- Enable back face culling. Back facing polygons will not be rendered.
Turning on back face culling can speed up rendering significantly, although
models which aren't 'solid' or which have inconsistently ordered polygons
will not be rendered correctly.
disableBackfaceCulling
public abstract void disableBackfaceCulling()
- Disable back face culling.
accumulate
public abstract void accumulate(float value)
- Multiply the contents of the color buffer by value and add
to the accumulation buffer. For this and all other
accumulation buffer operations, float is clamped to
[0, 1]. Accumulation has no effect if the Graphics3D has
no accumulation buffer.
accumLoad
public abstract void accumLoad(float value)
- Similar to accumulate, except that the values in the accumulation
buffer are replaced with the contents of the color buffer
multiplied by value.
accumReturn
public abstract void accumReturn(float value)
- Multiply the contents of the accumulation buffer by value and
load them into the color buffer.
accumMult
public abstract void accumMult(float value)
- Multiply the contents of the accumulation buffer by value.
All Packages Class Hierarchy This Package Previous Next Index