BenQ Mobile

javax.microedition.m3g
Class Graphics3D

java.lang.Object
  extended byjavax.microedition.m3g.Graphics3D

public class Graphics3D
extends java.lang.Object

A singleton 3D graphics context that can be bound to a rendering target. All rendering is done through the render methods in this class, including the rendering of World objects. There is no other way to draw anything in this API.


Field Summary
static int ANTIALIAS
          A parameter to bindTarget, specifying that antialiasing should be turned on.
static int DITHER
          A parameter to bindTarget, specifying that dithering should be turned on.
static int TRUE_COLOR
          A parameter to bindTarget, specifying that true color rendering should be turned on.
 
Method Summary
 int addLight(Light light, Transform transform)
          Binds a Light to use in subsequent immediate mode rendering.
 void bindTarget(java.lang.Object target)
          Binds the given Graphics or mutable Image2D as the rendering target of this Graphics3D.
 void bindTarget(java.lang.Object target, boolean depthBuffer, int hints)
          Binds the given Graphics or mutable Image2D as the rendering target of this Graphics3D.
 void clear(Background background)
          Clears the viewport as specified in the given Background object.
static Graphics3D getInstance()
          Retrieves the singleton Graphics3D instance that is associated with this application.
static java.util.Hashtable getProperties()
          Retrieves implementation specific properties.
 void releaseTarget()
          Flushes the rendered 3D image to the currently bound target and then releases the target.
 void render(Node node, Transform transform)
          Renders the given Sprite3D, Mesh, or Group node with the given transformation from local coordinates to world coordinates.
 void render(VertexBuffer vertices, IndexBuffer triangles, Appearance appearance, Transform transform)
          Renders the given submesh with the given transformation from local coordinates to world coordinates.
 void render(VertexBuffer vertices, IndexBuffer triangles, Appearance appearance, Transform transform, int scope)
          Renders the given submesh with the given scope and the given transformation from local coordinates to world coordinates.
 void render(World world)
          Renders an image of world as viewed by the active camera of that World.
 void resetLights()
          Clears the array of current Lights.
 void setCamera(Camera camera, Transform transform)
          Sets the Camera to use in subsequent immediate mode rendering.
 void setDepthRange(float near, float far)
          Specifies the mapping of depth values from normalized device coordinates to window coordinates.
 void setLight(int index, Light light, Transform transform)
          Binds or unbinds a Light for subsequent immediate mode rendering.
 void setViewport(int x, int y, int width, int height)
          Specifies a rectangular viewport on the currently bound rendering target.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ANTIALIAS

public static final int ANTIALIAS
A parameter to bindTarget, specifying that antialiasing should be turned on.

See Also:
Constant Field Values

DITHER

public static final int DITHER
A parameter to bindTarget, specifying that dithering should be turned on.

See Also:
Constant Field Values

TRUE_COLOR

public static final int TRUE_COLOR
A parameter to bindTarget, specifying that true color rendering should be turned on.

See Also:
Constant Field Values
Method Detail

getInstance

public static final Graphics3D getInstance()
Retrieves the singleton Graphics3D instance that is associated with this application.


bindTarget

public void bindTarget(java.lang.Object target)
Binds the given Graphics or mutable Image2D as the rendering target of this Graphics3D.


bindTarget

public void bindTarget(java.lang.Object target,
                       boolean depthBuffer,
                       int hints)
Binds the given Graphics or mutable Image2D as the rendering target of this Graphics3D.


releaseTarget

public void releaseTarget()
Flushes the rendered 3D image to the currently bound target and then releases the target.


setViewport

public void setViewport(int x,
                        int y,
                        int width,
                        int height)
Specifies a rectangular viewport on the currently bound rendering target.


setDepthRange

public void setDepthRange(float near,
                          float far)
Specifies the mapping of depth values from normalized device coordinates to window coordinates.


clear

public void clear(Background background)
Clears the viewport as specified in the given Background object.


render

public void render(World world)
Renders an image of world as viewed by the active camera of that World.


render

public void render(Node node,
                   Transform transform)
Renders the given Sprite3D, Mesh, or Group node with the given transformation from local coordinates to world coordinates.


render

public void render(VertexBuffer vertices,
                   IndexBuffer triangles,
                   Appearance appearance,
                   Transform transform,
                   int scope)
Renders the given submesh with the given scope and the given transformation from local coordinates to world coordinates.


render

public void render(VertexBuffer vertices,
                   IndexBuffer triangles,
                   Appearance appearance,
                   Transform transform)
Renders the given submesh with the given transformation from local coordinates to world coordinates.


setCamera

public void setCamera(Camera camera,
                      Transform transform)
Sets the Camera to use in subsequent immediate mode rendering.


setLight

public void setLight(int index,
                     Light light,
                     Transform transform)
Binds or unbinds a Light for subsequent immediate mode rendering.


addLight

public int addLight(Light light,
                    Transform transform)
Binds a Light to use in subsequent immediate mode rendering.


resetLights

public void resetLights()
Clears the array of current Lights.


getProperties

public static final java.util.Hashtable getProperties()
Retrieves implementation specific properties.


BenQ Mobile

Copyright © 2006 BenQ Mobile GmbH & Co. OHG or respective copyright owner.
All Rights Reserved.
BenQ Corp. is a trademark licensee of Siemens AG.


For further information about Mobility Toolkit (MTK) visit our Developer Portal.