Motorola E680 Technical Manual - Page 34
Using the Graphics3D object
View all Motorola E680 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 34 highlights
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(); } 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 { myG3D.render(myWorld); } finally { myG3D.releaseTarget(); } } 34
34
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();
}
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
{
myG3D.render(myWorld);
}
finally
{
myG3D.releaseTarget();
}
}