Welcome Guest!
Create Account | Login
Locator+ Code:

Search:
FTPOnline Channels Conferences Resources Hot Topics Partner Sites Magazines About FTP RSS 2.0 Feed

Free Subscription to Java Pro

email article
printer friendly
get the code

J2ME Lets You Go 3D
The time is ripe for 3D graphics programming for Java-enabled mobile devices through the M3G API
by Daniel F. Savarese

June 27, 2005

Just as nature abhors a vacuum, software abhors an underutilized CPU. The more capable a device, the more feature-rich its software will become. The graphics-capable devices catered to by Java 2 Platform, Micro Edition (J2ME)—from PDAs to cell phones—have become sufficiently powerful to render 3D graphics in real time. In addition to games, applications such as three-dimensional data visualization, mapping programs, and user interfaces require 3D graphics. The J2ME Mobile 3D Graphics API (M3G) bridges platform-specific graphics capabilities with a common programming interface for Java-enabled small devices. If you are already familiar with the MIDP 2.0 API, M3G provides a great way to enhance your J2ME projects.

ADVERTISEMENT

As with the Java 3D API (see "Learning to Fly," Java Pro, June 2003), the most difficult part of understanding M3G is figuring out where to get started if you have no prior experience with 3D graphics programming. In such a situation, I recommend inventing a simple program to write and scour the API for only those pieces you need to know as you write a particular part of the program. By the time you're done, you'll understand the API enough to study it in depth. Also, you'll realize a better way to write your familiarization program, which you'll promptly throw away. If you have prior experience with 3D graphics programming, you'll grasp M3G quickly because it borrows design concepts from OpenGL.

M3G supports two modes of operation: retained and immediate. Retained mode allows you to load and display prefabricated 3D environments. Immediate mode allows you to define 3D environments through direct instantiation and assembly of objects in a program. The distinction is somewhat artificial because the data structures required to support immediate mode are used by retained mode methods when they load scene graphs from persistent storage. Providing an immediate mode API is simply a matter of exposing publicly the private programming framework used by retained mode. Likewise, providing retained mode is simply a matter of building some scene graph parsers and combining them with scene assemblers built on top of the immediate mode framework.

This article requires registration. Please login below or click here to register.
 
E-mail Address:
Password:
Remember me:
 



Back to top













Java Pro | Visual Studio Magazine | Windows Server System Magazine
.NET Magazine | Enterprise Architect | XML & Web Services Magazine
VSLive! | Thunder Lizard Events | Discussions | Newsletters | FTP Home