J2ME Game Canvas and 3D Cube
import javax.microedition.lcdui.Graphics; import javax.microedition.lcdui.game.GameCanvas; import javax.microedition.m3g.*; public class My3DClass extends GameCanvas implements Runnable { private Graphics3D v3DInstance = Graphics3D.getInstance(); private Appearance vAppearance; private Material vMaterial; private VertexBuffer vVBuffer; private IndexBuffer vIBuffer; private Camera vCamera; private Background vBackground; private Transform vTransform; private Light vLight; private float vAngle; boolean vRunning; My3DClass() { //call the parent super(true); //initiate the variables vAppearance = new Appearance(); vMaterial = new Material(); vVBuffer = new VertexBuffer(); vCamera = new Camera(); vBackground = new Background(); vLight = new Light(); vTransform = new Transform(); vRunning = false; } public void init() ...