18 February 2008

M3G version 2.0

M3G (Mobile 3D Graphics API for Java, a.k.a. JSR-184) is an easy-to-use yet powerful 3D graphics API for mobile Java. It is primarily a retained-mode API: a model of the 3D scene is maintained inside the API, and individual objects and rendering assets can be inserted and manipulated via the API functions. The low-level rendering model is based on OpenGL ES, with the higher-level functionality layered on top. Compared with 2D bitmap graphics, 3D allows the games to pack larger numbers of smoother and richer animations into the same amount of memory. It also improves the sense of depth and perspective and enables cinematic camera controls, as illustrated in the adjacent figure. Most of the processing time in an interactive 3D game is usually spent in the core 3D routines that execute in optimized native code or use dedicated 3D hardware. Implementing 3D rendering in Java alone would be prohibitively slow, which is why M3G was designed.

At the lowest level, M3G deals with concepts similar to those in OpenGL ES: vertex buffers, textures, light sources, materials, and transformation matrices. These are the building blocks for higher-level objects and scene graphs. Vertex and index buffers can be combined into Mesh objects; textures, materials, and other rendering parameters form Appearance objects for shading; Group nodes allow logical grouping and hierarchic transformation of scene elements. The higher-level features, enabled by the scene-graph approach, include functionality commonly required in games and other interactive 3D graphics applications. The aim in designing M3G was to build in common functionality that most applications will need in any case, without being too application-specific. This reduces application size and improves developer productivity. It also improves overall application performance, because raising the abstraction level allows M3G to batch-process entire 3D scenes in native code.

More information:

http://www.acmqueue.com/modules.php?name=Content&pa=showpage&pid=520