Motorola MOTORAZR maxx V6 Developer's Manual page 106

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
{
myG3D.render(myWorld);
}
finally
{
myG3D.releaseTarget();
}
}
}
The final block makes sure that the target is released and the Graphics3D can be re-
used. The bindTarget call must be outside the try block, as it can throw exceptions
that will cause releaseTarget to be called when a target has not been bound, and re-
leaseTarget throwing an exception.
13.4.5 Interrogating and interacting with
objects
The World object is a container that sits at the top of the hierarchy of objects that
form the scene graph. You can find particular objects within the scene very simply by
calling find() with an ID. find() returns a reference to the object which has been as-
signed that ID in the authoring tool (or manually assigned from code). This is im-
portant because it largely makes the application logic independent of the detailed
structure of the scene.
final int PERSON_OBJECT_ID = 339929883;
Node personNode = (Node)theWorld.find(PERSON_OBJECT_ID);
If you need to find many objects, or you don't have a fixed ID, then you can follow
the hierarchy explicitly using the Object3D.getReferences() or Group.getChild()
methods.
DRAFT - Subject to Change
Code Sample 5 Using the Graphics3D object
Code Sample 6 Finding objects by ID.
[106/201]

Advertisement

Table of Contents
loading

Table of Contents