com.mascotcapsule.micro3d.v3
Class Graphics3D

java.lang.Object
  extended bycom.mascotcapsule.micro3d.v3.Graphics3D

public class Graphics3D
extends java.lang.Object

This class provides 3D graphics rendering functions.
Graphics3D binds a javax.microedition.lcdui.Graphics object and performs rendering operations upon it.

It may render to an offscreen object by binding to javax.microedition.lcdui.Image::getGraphics()

Example:
A code fragment illustrating the usage of Graphics3D.
 import  java.io.*;
 import  javax.microedition.io.*;
 import  javax.microedition.lcdui.*;
 import  javax.microedition.midlet.*;
 import  com.mascotcapsule.micro3d.v3.*;
 
 public class MyG3DExample extends MIDlet
 {
	public void startApp(){
	Display d = Display.getDisplay(this);
	d.setCurrent( new MyCanvas() );
	}
	public void pauseApp(){
	}
	public void destroyApp( boolean b ){
	}
 }
 class MyCanvas extends Canvas 
 {
	Graphics3D g3d = new Graphics3D();
 
	protected void paint(Graphics g) 
	{
		// The paint method is called by MIDP after the application has issued
		// a repaint request. We draw a new frame on this Canvas by binding the
		// current Graphics object as the target, then rendering, and finally
		// releasing the target.
 
		g.setColor(0xFFFFFF);
		g.fillRect(0,0, getWidth(), getHeight());

		Figure figure = null;
		Texture tex = null;
		ActionTable action = null;
 
		// Almighty Truls know what this mean!
		FigureLayout layout = new FigureLayout();
		Effect3D effect = new Effect3D();
		AffineTrans trans = new AffineTrans();
 
		trans.lookAt( new Vector3D(0, 0, 2048), new Vector3D(0, 0, -2048), new Vector3D(0, 4096, 0) );
		layout.setAffineTrans( trans );
 
		try {
			figure = new Figure( "/figure.mbac" );
			tex = new Texture( "/figure.bmp",true );
			figure.setTexture( tex );
			action = new ActionTable( "/figure.mtra" );
			figure.setPosture( action, 0, 0 );
		} catch( Exception e ) {}
		
		// Bind the 3D graphics context to the given MIDP Graphics object.
		g3d.bind(g);

		try {
			g3d.renderFigure( figure, 80, 100, layout, effect );
			g3d.flush(); // flush the rendered figure
		} catch( Exception e ) {}
		
		// Release the MIDP Graphics object.
		g3d.release( g );
	}
 }
 
 


Field Summary
static int COMMAND_AFFINE_INDEX
          Command equivalent to FigureLayout#selectAffineTrans(int)(=0x87000000).
static int COMMAND_AMBIENT_LIGHT
          Command equivalent to Light#setAmbIntensity(int)(=0xa0000000).
static int COMMAND_ATTRIBUTE
          Command for setting environment attributes(=0x83000000).
static int COMMAND_CENTER
          Command equivalent to FigureLayout#setCenter(int, int)(=0x85000000).
static int COMMAND_CLIP
          Command that sets the clip coordinates(=0x84000000).
static int COMMAND_DIRECTION_LIGHT
          Command equivalent to Light#setParallelLightDirection(Vector3D) and command equivalent to Light#setParallelLightIntensity(int) (=0xa1000000).
static int COMMAND_END
          Command that indicates exiting the command list(0x80000000)
static int COMMAND_FLUSH
          Command equivalent to Graphics3D#flush()(=0x82000000)
static int COMMAND_LIST_VERSION_1_0
          Command that indicates the version of the command list
static int COMMAND_NOP
          Command that indicates no processing(=0x81000000).
static int COMMAND_PARALLEL_SCALE
          Command equivalent to FigureLayout#setScale(int, int)(=0x90000000).
static int COMMAND_PARALLEL_SIZE
          Command equivalent to FigureLayout#setParallelSize(int, int)(=0x91000000).
static int COMMAND_PERSPECTIVE_FOV
          Command equivalent to FigureLayout#setPerspective(int, int, int)(=0x92000000).
static int COMMAND_PERSPECTIVE_WH
          Command equivalent to FigureLayout#setPerspective(int, int, int, int) (=0x93000000).
static int COMMAND_TEXTURE_INDEX
          Command equivalent to Figure#selectTexture(int)(=0x86000000).
static int COMMAND_THRESHOLD
          Command equivalent to Effect3D#setToonParams(int, int, int)(=0xaf000000).
static int ENV_ATTR_LIGHTING
          Environment attribute enabling light(=1).
static int ENV_ATTR_SEMI_TRANSPARENT
          Environment attribute enabling semitransparent processing(semitransparent, add, subtract)(=8).
static int ENV_ATTR_SPHERE_MAP
          Environment attribute enabling sphere mapping(=2).
static int ENV_ATTR_TOON_SHADING
          Environment attribute that performs toon shading(=4).
static int PATTR_BLEND_ADD
          Primitive attribute that performs additive blending(=0x40).
static int PATTR_BLEND_HALF
          Primitive attribute that performs semitransparent processing(=0x20).
static int PATTR_BLEND_NORMAL
          Primitive attribute that performs blend processing(=0x00).
static int PATTR_BLEND_SUB
          Primitive attribute that performs subtractive blending(=0x60).
static int PATTR_COLORKEY
          Primitive attribute that performs semitransparent processing using color keys(=0x10).
static int PATTR_LIGHTING
          Primitive attribute enabling light(=0x01)
static int PATTR_SPHERE_MAP
          Primitive attribute enabling environment mapping(=0x02).
static int PDATA_COLOR_NONE
          Primitive type with no color data(=0x0000).
static int PDATA_COLOR_PER_COMMAND
          Primitive type with color data per command(=0x0400).
static int PDATA_COLOR_PER_FACE
          Primitive type with color data per face(=0x0800).
static int PDATA_NORMAL_NONE
          Primitive type with no normal data(=0x0000).
static int PDATA_NORMAL_PER_FACE
          Primitive type with normal data per face(=0x0200).
static int PDATA_NORMAL_PER_VERTEX
          Primitive type with normal data per vertex(=0x0300).
static int PDATA_POINT_SPRITE_PARAMS_PER_CMD
          Primitive type with point sprite coordinate data per command(=0x1000).
static int PDATA_POINT_SPRITE_PARAMS_PER_FACE
          Primitive type with point sprite coordinate data per face(=0x2000).
static int PDATA_POINT_SPRITE_PARAMS_PER_VERTEX
          Primitive type with point sprite coordinate data per vertex(=0x3000).
static int PDATA_TEXURE_COORD
          Primitive type with texture coordinate data(=0x3000).
static int PDATA_TEXURE_COORD_NONE
          Primitive type with no texture coordinate data(=0x0000).
static int POINT_SPRITE_LOCAL_SIZE
          Point sprite flag for specifying size in the model coordinate system(=0).
static int POINT_SPRITE_NO_PERS
          Point sprite flag for 'path disabled' in prospective projection(=2).
static int POINT_SPRITE_PERSPECTIVE
          Point sprite flag for 'path enabled' in prospective projection(=0).
static int POINT_SPRITE_PIXEL_SIZE
          Point sprite flag for specifying size in the screen coordinate system(=1).
static int PRIMITVE_LINES
          Line rendering command(=0x02000000).
static int PRIMITVE_POINT_SPRITES
          Point sprite rendering command(=0x05000000).
static int PRIMITVE_POINTS
          Point rendering command(=0x01000000).
static int PRIMITVE_QUADS
          Quadrilateral rendering command(=0x04000000).
static int PRIMITVE_TRIANGLES
          Triangle rendering command(=0x03000000).
 
Constructor Summary
Graphics3D()
          Public constructor.
 
Method Summary
 void bind(Graphics graphics)
          Binds a rendering target.
 void dispose()
          Releases the rendering memory area being held.
 void drawCommandList(Texture[] textures, int x, int y, FigureLayout layout, Effect3D effect, int[] commandList)
          Specifies the command array and executes the rendering process.
 void drawCommandList(Texture texture, int x, int y, FigureLayout layout, Effect3D effect, int[] commandList)
           
 void drawFigure(Figure figure, int x, int y, FigureLayout layout, Effect3D effect)
          Renders a 3D model.
 void flush()
          Actual rendering occurs based on registered rendering data.
 void release(Graphics graphics)
          Releases a rendering target
 void renderFigure(Figure figure, int x, int y, FigureLayout layout, Effect3D effect)
          Enters model data settings and executes rendering operation.
 void renderPrimitives(Texture texture, int x, int y, FigureLayout layout, Effect3D effect, int command, int numPrimitives, int[] vertexCoords, int[] normals, int[] textureCoords, int[] colors)
          Multiple primitive renderings are registered at one time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMMAND_LIST_VERSION_1_0

public static final int COMMAND_LIST_VERSION_1_0
Command that indicates the version of the command list

See Also:
Constant Field Values

COMMAND_END

public static final int COMMAND_END
Command that indicates exiting the command list(0x80000000)

See Also:
Constant Field Values

COMMAND_NOP

public static final int COMMAND_NOP
Command that indicates no processing(=0x81000000). When using this command, enter the logical OR of the number of processes to be ignored.

See Also:
Constant Field Values

COMMAND_FLUSH

public static final int COMMAND_FLUSH
Command equivalent to Graphics3D#flush()(=0x82000000)

See Also:
flush(), Constant Field Values

COMMAND_ATTRIBUTE

public static final int COMMAND_ATTRIBUTE
Command for setting environment attributes(=0x83000000). When using this command, enter the logical OR of environment attributes (ENV_ATTR_XXXX).

See Also:
Constant Field Values

COMMAND_CLIP

public static final int COMMAND_CLIP
Command that sets the clip coordinates(=0x84000000). Following this command, enter the range of the clip in the sequence left, top, right and bottom.

See Also:
Constant Field Values

COMMAND_CENTER

public static final int COMMAND_CENTER
Command equivalent to FigureLayout#setCenter(int, int)(=0x85000000). Following this command, enter the center of screen coordinates in the sequence x and y.

See Also:
FigureLayout.setCenter(int, int), Constant Field Values

COMMAND_TEXTURE_INDEX

public static final int COMMAND_TEXTURE_INDEX
Command equivalent to Figure#selectTexture(int)(=0x86000000). When using this command, Figure#setTexture() must be used beforehand to set the texture array. When setting this command, a logical OR must be entered for the texture index to be used.

See Also:
Figure.selectTexture(int), Constant Field Values

COMMAND_AFFINE_INDEX

public static final int COMMAND_AFFINE_INDEX
Command equivalent to FigureLayout#selectAffineTrans(int)(=0x87000000). When using this command, FigureLayout#setViewTransArray() must be used beforehand to set the array of the scene viewing position matrix. When specifying this command, a logical OR is entered for the index of the scene viewing position to be used.

See Also:
FigureLayout.selectAffineTrans(int), FigureLayout.setAffineTrans(AffineTrans[]), Constant Field Values

COMMAND_PARALLEL_SCALE

public static final int COMMAND_PARALLEL_SCALE
Command equivalent to FigureLayout#setScale(int, int)(=0x90000000). Following this command, enter the parallel projection scale in the sequence x and y.

See Also:
FigureLayout.setScale(int, int), Constant Field Values

COMMAND_PARALLEL_SIZE

public static final int COMMAND_PARALLEL_SIZE
Command equivalent to FigureLayout#setParallelSize(int, int)(=0x91000000). Following this command, enter the parallel projection size in the sequence width and height.

See Also:
FigureLayout.setParallelSize(int, int), Constant Field Values

COMMAND_PERSPECTIVE_FOV

public static final int COMMAND_PERSPECTIVE_FOV
Command equivalent to FigureLayout#setPerspective(int, int, int)(=0x92000000). Following this command, enter the perspective projection parameters in the sequence distance to near-clipped surface, distance to far-clipped surface, angle of view.

See Also:
FigureLayout.setPerspective(int, int, int), Constant Field Values

COMMAND_PERSPECTIVE_WH

public static final int COMMAND_PERSPECTIVE_WH
Command equivalent to FigureLayout#setPerspective(int, int, int, int) (=0x93000000). Following this command, enter the perspective projection parameters in the sequence distance to near-clipped surface, distance to far-clipped surface, near-clipped surface width and near-clipped surface height.

See Also:
FigureLayout.setPerspective(int, int, int, int), Constant Field Values

COMMAND_AMBIENT_LIGHT

public static final int COMMAND_AMBIENT_LIGHT
Command equivalent to Light#setAmbIntensity(int)(=0xa0000000). Following this command, enter the intensity of the ambient light.

See Also:
Light.setAmbIntensity(int), Constant Field Values

COMMAND_DIRECTION_LIGHT

public static final int COMMAND_DIRECTION_LIGHT
Command equivalent to Light#setParallelLightDirection(Vector3D) and command equivalent to Light#setParallelLightIntensity(int) (=0xa1000000). Following these commands, enter settings in the sequence light directions x, y, z and then light intensity.

See Also:
Light.setParallelLightDirection(Vector3D), Light.setParallelLightIntensity(int), Constant Field Values

COMMAND_THRESHOLD

public static final int COMMAND_THRESHOLD
Command equivalent to Effect3D#setToonParams(int, int, int)(=0xaf000000). Following this command, enter settings in the sequence threshold, high and low.

See Also:
Effect3D.setToonParams(int, int, int), Constant Field Values

PRIMITVE_POINTS

public static final int PRIMITVE_POINTS
Point rendering command(=0x01000000).

See Also:
Constant Field Values

PRIMITVE_LINES

public static final int PRIMITVE_LINES
Line rendering command(=0x02000000).

See Also:
Constant Field Values

PRIMITVE_TRIANGLES

public static final int PRIMITVE_TRIANGLES
Triangle rendering command(=0x03000000).

See Also:
Constant Field Values

PRIMITVE_QUADS

public static final int PRIMITVE_QUADS
Quadrilateral rendering command(=0x04000000).

See Also:
Constant Field Values

PRIMITVE_POINT_SPRITES

public static final int PRIMITVE_POINT_SPRITES
Point sprite rendering command(=0x05000000).

See Also:
Constant Field Values

POINT_SPRITE_LOCAL_SIZE

public static final int POINT_SPRITE_LOCAL_SIZE
Point sprite flag for specifying size in the model coordinate system(=0).

See Also:
Constant Field Values

POINT_SPRITE_PIXEL_SIZE

public static final int POINT_SPRITE_PIXEL_SIZE
Point sprite flag for specifying size in the screen coordinate system(=1).

See Also:
Constant Field Values

POINT_SPRITE_PERSPECTIVE

public static final int POINT_SPRITE_PERSPECTIVE
Point sprite flag for 'path enabled' in prospective projection(=0).

See Also:
Constant Field Values

POINT_SPRITE_NO_PERS

public static final int POINT_SPRITE_NO_PERS
Point sprite flag for 'path disabled' in prospective projection(=2).

See Also:
Constant Field Values

ENV_ATTR_LIGHTING

public static final int ENV_ATTR_LIGHTING
Environment attribute enabling light(=1).

See Also:
Constant Field Values

ENV_ATTR_SPHERE_MAP

public static final int ENV_ATTR_SPHERE_MAP
Environment attribute enabling sphere mapping(=2).

See Also:
Constant Field Values

ENV_ATTR_TOON_SHADING

public static final int ENV_ATTR_TOON_SHADING
Environment attribute that performs toon shading(=4).

See Also:
Constant Field Values

ENV_ATTR_SEMI_TRANSPARENT

public static final int ENV_ATTR_SEMI_TRANSPARENT
Environment attribute enabling semitransparent processing(semitransparent, add, subtract)(=8).

See Also:
Constant Field Values

PATTR_LIGHTING

public static final int PATTR_LIGHTING
Primitive attribute enabling light(=0x01)

See Also:
Constant Field Values

PATTR_SPHERE_MAP

public static final int PATTR_SPHERE_MAP
Primitive attribute enabling environment mapping(=0x02).

See Also:
Constant Field Values

PATTR_COLORKEY

public static final int PATTR_COLORKEY
Primitive attribute that performs semitransparent processing using color keys(=0x10).

See Also:
Constant Field Values

PATTR_BLEND_NORMAL

public static final int PATTR_BLEND_NORMAL
Primitive attribute that performs blend processing(=0x00).

See Also:
Constant Field Values

PATTR_BLEND_HALF

public static final int PATTR_BLEND_HALF
Primitive attribute that performs semitransparent processing(=0x20).

See Also:
Constant Field Values

PATTR_BLEND_ADD

public static final int PATTR_BLEND_ADD
Primitive attribute that performs additive blending(=0x40).

See Also:
Constant Field Values

PATTR_BLEND_SUB

public static final int PATTR_BLEND_SUB
Primitive attribute that performs subtractive blending(=0x60).

See Also:
Constant Field Values

PDATA_NORMAL_NONE

public static final int PDATA_NORMAL_NONE
Primitive type with no normal data(=0x0000).

See Also:
Constant Field Values

PDATA_NORMAL_PER_FACE

public static final int PDATA_NORMAL_PER_FACE
Primitive type with normal data per face(=0x0200).

See Also:
Constant Field Values

PDATA_NORMAL_PER_VERTEX

public static final int PDATA_NORMAL_PER_VERTEX
Primitive type with normal data per vertex(=0x0300).

See Also:
Constant Field Values

PDATA_COLOR_NONE

public static final int PDATA_COLOR_NONE
Primitive type with no color data(=0x0000).

See Also:
Constant Field Values

PDATA_COLOR_PER_COMMAND

public static final int PDATA_COLOR_PER_COMMAND
Primitive type with color data per command(=0x0400).

See Also:
Constant Field Values

PDATA_COLOR_PER_FACE

public static final int PDATA_COLOR_PER_FACE
Primitive type with color data per face(=0x0800).

See Also:
Constant Field Values

PDATA_TEXURE_COORD_NONE

public static final int PDATA_TEXURE_COORD_NONE
Primitive type with no texture coordinate data(=0x0000).

See Also:
Constant Field Values

PDATA_POINT_SPRITE_PARAMS_PER_CMD

public static final int PDATA_POINT_SPRITE_PARAMS_PER_CMD
Primitive type with point sprite coordinate data per command(=0x1000).

See Also:
Constant Field Values

PDATA_POINT_SPRITE_PARAMS_PER_FACE

public static final int PDATA_POINT_SPRITE_PARAMS_PER_FACE
Primitive type with point sprite coordinate data per face(=0x2000).

See Also:
Constant Field Values

PDATA_POINT_SPRITE_PARAMS_PER_VERTEX

public static final int PDATA_POINT_SPRITE_PARAMS_PER_VERTEX
Primitive type with point sprite coordinate data per vertex(=0x3000).

See Also:
Constant Field Values

PDATA_TEXURE_COORD

public static final int PDATA_TEXURE_COORD
Primitive type with texture coordinate data(=0x3000).

See Also:
Constant Field Values
Constructor Detail

Graphics3D

public Graphics3D()
Public constructor.

Method Detail

bind

public final void bind(Graphics graphics)
                throws java.lang.IllegalStateException,
                       java.lang.NullPointerException
Binds a rendering target.

NOTE! All rendering operations must take place between a bind and a release

Parameters:
graphics - Rendering target to be bound
Throws:
java.lang.IllegalStateException - When a rendering target is already bound
java.lang.NullPointerException - When parameter graphics is null

release

public final void release(Graphics graphics)
                   throws java.lang.IllegalArgumentException,
                          java.lang.NullPointerException
Releases a rendering target

Parameters:
graphics - Rendering target to be released
Throws:
java.lang.IllegalArgumentException - When a rendering target differs from the target bound
java.lang.NullPointerException - When parameter graphics is null

renderPrimitives

public final void renderPrimitives(Texture texture,
                                   int x,
                                   int y,
                                   FigureLayout layout,
                                   Effect3D effect,
                                   int command,
                                   int numPrimitives,
                                   int[] vertexCoords,
                                   int[] normals,
                                   int[] textureCoords,
                                   int[] colors)
Multiple primitive renderings are registered at one time. After registration, there is no rendering until the equivalent of Graphics3D#flush() is called. The following data require registration:

Parameters:
x - Rendering position x coordinate
y - Rendering position y coordinate
layout - Rendering layout object
effect - Rendering effect object
command - Value from composite of primitive type, attribute and data type using the logical OR
numPrimitives - Total number of primitives
vertexCoords - Vertex data array
normals - Normal data array
textureCoords - Texture coordinate data array
colors - Color data array
Throws:
java.lang.NullPointerException - When a null is specified for either the arguments figure, layout, effect, vertexCoords, normals, textureCoords, or colors.
java.lang.IllegalArgumentException - When the argument command is negative. When numPrimitives is 0 or lower or 256 or higher. Failure during rendering with the native engine for a reason such as a logical contradiction in the content of the argument object.
java.lang.RuntimeException - Failure during rendering with the native engine for an unexpected reason such as insufficient memory.
See Also:
flush()

drawCommandList

public final void drawCommandList(Texture[] textures,
                                  int x,
                                  int y,
                                  FigureLayout layout,
                                  Effect3D effect,
                                  int[] commandList)
Specifies the command array and executes the rendering process. Actual rendering will not occur until a command is used to specify COMMAND_FLUSH, or Graphics3D#flush() is called. With this method, the data specification method is more complicated than #renderPrimitives(), but its the advantage is that it is able to lower the number of method calls until actual rendering, reducing overhead. As a result, some functions have no effect on this method and instead must be specified as elements of a command array.
 Methods disabled while this method processes and formatting in the command form:
   FigureLayout#setCenter(int, int)
     ?¨ COMMAND_CENTER, x, y
   Figure#selectTexture(int)
     ?¨ COMMAND_TEXTURE_INDEX | index
   FigureLayout#selectAffineTrans(int)
     ?¨ COMMAND_AFFINE_INDEX | index
   FigureLayout#setScale(int, int)
     ?¨ COMMAND_PARALLEL_SCALE, width, height
   FigureLayout#setParallelSize(int, int)
     ?¨ COMMAND_PARALLEL_SIZE, width, height
   FigureLayout#setPerspective(int, int, int)
     ?¨ COMMAND_PERSPECTIVE_FOV, zNear, zFar, angle
   FigureLayout#setPerspective(int, int, int, int)
     ?¨ COMMAND_PERSPECTIVE_WH, zNear, zFar, width, height
   Light#setParallelLightDirection(Vector3D) and
   Light#setParallelLightIntensity(int)
     ?¨ COMMAND_DIRECTION_LIGHT,
        Vector3D.x, Vector3D.y, Vector3D.z, dirIntensity
   Light#setAmbientIntensity(int)
     ?¨ COMMAND_AMBIENT_LIGHT, ambIntensity
   Effect3D#setToonParams(int, int, int)
     ?¨ COMMAND_THRESHOLD, threshold, high, low

  Examples of command array settings:
  int commandlist[] = {
    // Class name ((Graphics3D)g) has been omitted from the description
    COMMAND_LIST_VERSION_1_0, // Requires version specifiction
    COMMAND_CENTER, cx, cy,
    COMMAND_PERSPECTIVE_WH, 1024, 4096, 4096*150, 4096*150,
    COMMAND_AMBIENT_LIGHT, ambIntensity,
    COMMAND_DIRECTION_LIGHT, -1024, 0, 0, dirIntensity,
    COMMAND_TEXTURE_INDEX | 0, // When Texture[] is set
    COMMAND_AFFINE_INDEX | 2, // When AffineTrans[] is set
    // Triangular polygon specification
    PRIMITVE_TRIANGLES | PDATA_NORMAL_PER_FACE | PDATA_COLOR_PER_FACE |
    ENV_ATTR_LIGHTING | ENV_ATTR_SPHERE_MAP | PATTR_BLEND_HALF |
    (2 <<16), // quantity2
    0,0,0, 0,0,100, 0,100,0,
    0,100,100, 0,0,100, 0,100,0,
    4096,0,0, 4096,0,0, // normal
    255<<16 | 255<<8 | 0, // color
    255<<16 | 128<<8 | 0, // color
    // Quadrilateral polygon specification
    PRIMITVE_QUADS | PDATA_NORMAL_PER_FACE | PDATA_TEXURE_COORD |
    ENV_ATTR_LIGHTING | ENV_ATTR_SPHERE_MAP | PATTR_BLEND_ADD |
    (1 <<16), // quantity1
    0,0,0, 100,0,0, 100,100,0, 0,100,0,
    0,0,4096, // normal
    128,0, 128,128, 0,128, 0,0, // texture
    PRIMITVE_QUADS | PDATA_NORMAL_PER_FACE | PDATA_TEXURE_COORD |
    ENV_ATTR_LIGHTING | ENV_ATTR_SPHERE_MAP | PATTR_BLEND_SUB |
    (1 <<16), // quantity1
    0,0,0, 0,0,100, 100,0,100, 100,0,0,
    0,4096,0, // normal
    128,0, 128,128, 0,128, 0,0, // texture
    // rendering
    COMMAND_FLUSH, // Not executed here, and flush() may be called later
    COMMAND_END,
  };
  drawCommandList(commandlist); // Other arguments have been omitted from the description 
 

Parameters:
textures - Textures to be used
x - rendering position x coordinate
y - rendering position y coordinate
layout - Rendering layout object
effect - Rendering effect object
commandList - Command set array
Throws:
java.lang.NullPointerException - When a null is specified for either of arguments figure, layout, effect, or commandlist.
java.lang.IllegalArgumentException - The version of the lead command list is outside of supported values. An invalid command was encountered during execution. Failure during rendering with the native engine for a reason such as a logical contradiction in the content of the argument object.
java.lang.RuntimeException - Failure during rendering with the native engine for an unexpected reason such as insufficient memory.
See Also:
flush(), FigureLayout.setCenter(int, int), Figure.selectTexture(int), FigureLayout.selectAffineTrans(int), FigureLayout.setScale(int, int), FigureLayout.setParallelSize(int, int), FigureLayout.setPerspective(int, int, int), FigureLayout.setPerspective(int, int, int, int), Light.setParallelLightDirection(Vector3D), Light.setParallelLightIntensity(int), Light.setAmbientIntensity(int), Effect3D.setToonParams(int, int, int)

drawCommandList

public final void drawCommandList(Texture texture,
                                  int x,
                                  int y,
                                  FigureLayout layout,
                                  Effect3D effect,
                                  int[] commandList)

renderFigure

public final void renderFigure(Figure figure,
                               int x,
                               int y,
                               FigureLayout layout,
                               Effect3D effect)
                        throws java.lang.IllegalStateException
Enters model data settings and executes rendering operation. Unlike #drawFigure(), actual rendering will not occur until flush() is called and only the rendering operation will execute.

Parameters:
figure - 3D model object
x - Rendering position x coordinate
y - Rendering position y coordinate
layout - Rendering layout object
effect - Rendering effect object
Throws:
java.lang.NullPointerException - When a null is specified for either the figure, layout, or effect of an argument.
java.lang.IllegalArgumentException - Failure during rendering with the native engine for a reason such as a logical contradiction in the content of the argument object.
java.lang.RuntimeException - Failure during rendering with the native engine for an unexpected reason such as insufficient memory.
java.lang.IllegalStateException
See Also:
drawFigure(com.mascotcapsule.micro3d.v3.Figure, int, int, com.mascotcapsule.micro3d.v3.FigureLayout, com.mascotcapsule.micro3d.v3.Effect3D), flush()

drawFigure

public final void drawFigure(Figure figure,
                             int x,
                             int y,
                             FigureLayout layout,
                             Effect3D effect)
                      throws java.lang.IllegalStateException
Renders a 3D model.

Parameters:
figure - 3D model object
x - Rendering position x coordinate
y - Rendering position y coordinate
layout - Rendering layout object
effect - Rendering effect object
Throws:
java.lang.NullPointerException - When a null is specified for either the figure, layout, or effect of an argument.
java.lang.IllegalArgumentException - Failure during rendering with the native engine for a reason such as a logical contradiction in the content of the argument object.
java.lang.RuntimeException - Failure during rendering with the native engine for an unexpected reason such as insufficient memory.
java.lang.IllegalStateException

flush

public final void flush()
                 throws java.lang.IllegalStateException
Actual rendering occurs based on registered rendering data. All registered data is lost after rendering.

Throws:
java.lang.RuntimeException - Failure during rendering with the native engine for a reason such as a logical contradiction in the content of the argument object. Failure during rendering with the native engine for an unexpected reason such as insufficient memory.
java.lang.IllegalStateException

dispose

public final void dispose()
Releases the rendering memory area being held. After calling this method, nothing will occur even if a rendering method is used.