O'Reilly logo

MPEG-4 Book, The by Touradj Ebrahimi, Fernando Pereira

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

E.1. Scene APIs

The following example shows a complete MPEGlet[1] using the Scene API to invert the color of a shape node when the user clicks on it. In this example, SceneExampleMpeglet implements the MPEGlet interface, SceneListener interface, and the EventOutListener interface. Initially, the SceneManager object is obtained from the MpegjTerminal and the MPEGlet adds itself as the SceneListener. Then the MPEGlet retrieves a reference to the TouchSensorNode (defined with the name TOUCH) and registers itself to be notified when the user clicks on the TouchSensorNode. Finally, the MPEGlet inverts the color of the shape node (defined with the name “MATERIAL”) when the MPEGlet receives the touch event.

[1] MPEG-J applications are called MPEGlets. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required