Motorola MOTORAZR maxx V6 Developer's Manual page 105

Java me developer guide
Hide thumbs Also See for MOTORAZR maxx V6:
Table of Contents

Advertisement

Java ME Developer Guide
Chapter 13 - JSR-184 - Mobile 3D Graphics API
public void startApp() throws MIDletStateChangeException
{
myDisplay.setCurrent(myCanvas);
try
{
// Load a file.
Objects3D[] roots = Loader.load(getAppProperty("Content-1"));
// Assume the world is the first root node loaded.
myWorld = (World) roots[0];
}
catch(Exception e)
{
e.printStackTrace();
}
// Force a repaint so the update loop is started.
myCanvas.repaint();
}
13.4.4 Using the Graphics3D object
Using the Graphics3D is very straightforward. Get the Graphics3D instance, bind a
target to it, render everything, and release the target.
public class myCanvas extends Canvas
{
Graphics3D myG3D = Graphics3D.getInstance();
public void paint(Graphics g)
{
myG3D.bindTarget(g);
try
DRAFT - Subject to Change
Code Sample 4 Initializing the world
[105/201]

Advertisement

Table of Contents
loading

Table of Contents