Welcome!

AJAX & REA Authors: John Funnell, Bob Little, Kevin Hoffman, Maureen O'Gara, Onkar Singh

Related Topics: AJAX & REA

AJAX & REA: Article

AJAX3D - The Open Platform For Rich 3D Web Applications

Real-time 3D is emerging as a first-class media type for the Web

The scene graph is hierarchical, but it's not a strict tree like a DOM document. Objects in the scene graph can have multiple parents so long as no object is a descendant of itself either directly or indirectly. The technical term for this structure is a Directed Acyclic Graph or DAG ­ hence the term "scene graph." Many operations on the X3D scene graph require knowledge of this structure so it's important to understand this concept early on.

Nodes, Fields, and Events
The fundamental object type in X3D is the node. Nodes are scene graph elements; they can represent geometric shapes, their visual properties, animations, scripts that contain program code, clickable behaviors, and so on. The properties of nodes are called fields; fields store basic data type information such as floating point values, integers, strings, 2D and 3D vectors, bitmapped images, and arrays of those types.

Dynamic behaviors in the scene graph are accomplished via events ­ fields that let their values be changed, or that tell the application when their values have changed. An AJAX3D application can send events via the SAI using a straightforward JavaScript property-setting syntax as in the following example:

theText.string[0] = "Hello";
theText.string[1] = "AJAX3D!";

The SAI also defines field listeners: objects with callback methods that are invoked when an event is generated. Here's an example of adding a field listener to a TouchSensor ­ an object that tells the programmer when some geometry in the world has been clicked on (by generating a touchTime event):

var observer = new Object;
observer.readableFieldChanged = clickCallback; sensor1.touchTime.addFieldEventListener(observer);

Dynamically Generating Scene Graph Content
The SAI supports the dynamic generation of X3D content from strings, URLs, or using factories that create nodes by type. Here's an example of creating X3D with a string:

var str = "<Shape><Box size='.5 .5 .1'/></Shape>";
var newscene = Browser.createX3DFromString(str);

By combining this capability with AJAX techniques (i.e., using XMLHttpRequest), an AJAX3D application can build an entire 3D world programmatically based, for example, on queries to a MySQL database.

Taken together, the ability to control rich X3D worlds from JavaScript running in Web pages, to update Web pages based on events that occur in the world, and to dynamically build worlds from program code make AJAX3D a complete system for delivering 3D applications on the Web. The possibilities of this approach are endless, and this presents a challenge: how to best harness the vast power of AJAX3D into a useable set of tools and framework code for developing a broad range of applications. We will explore this issue below, but first an example.

Example: The Strikefighter
Larry Rosenthal of Cube Productions has been designing real-time 3D content for over 15 years and has been running a science fiction virtual world/online community called StarbaseC3 for nearly that long. In 2001 he developed the first version of a 3D Web game called "Strikefighter" based on StarbaseC3 models. Over the years Larry has updated the game from time to time, and ported it across various 3D engines, both open and proprietary.

Larry teamed up with programmer Dave Arendash to once again port Strikefighter (shown in Figure 1). Using AJAX3D, Dave connected the game to a live Web server (running PHP and MySQL) that implements a scoreboard. When the game is over, it checks the current score against a database of high scores residing on the server. If the player's score is in the top 10 he's invited to post his name on the public scoreboard. Strikefighter is similar to the Flash-based mini-games that have proliferated on the Web over the last several years. Until AJAX3D, Larry wasn't able to deploy a 3D game like this based on a royalty-free, open platform that fully integrates with a Web server and runs on a page.

The AJAX3D Initiative
In a sense, the technical underpinnings for AJAX3D, like those of AJAX itself, are almost trivially simple (that is, if one considers Web browsers, XML, and real-time 3D Web plug-ins "simple" things). There are a small number of basic constructs involved: JavaScript, XMLHttpRequest, the DOM, and the SAI. However, the many possible combinations of these, combined with the ability to deliver code and content worldwide at nearly the speed of thought, have profound implications.

AJAX3D promises a royalty-free, open, global platform for creating a next-generation Web experience. The key to realizing that promise lies in establishing techniques and best practices that can be used throughout the industry, supported by tools and frameworks, and developed in an open setting. In other words, AJAX3D is as much about community process and collaboration as it is about technology.

In August 2006, Media Machines launched www.ajax3d.org as an open industry body to foster AJAX3D development. The site has a large mailing list, active discussion forums, and several examples. Media Machines intends to hand the maintenance and governance of the site, and the project as a whole, over to an all-volunteer group in the near future.

With the initial launch of AJAX3D, we have just scratched the surface of what is possible. The group has identified important next steps to be taken over the next several months:

  • Develop a programming framework ("ajax3dlib"): The first tutorials hint at a general-purpose programming framework, but there's still a lot of work to be done in this area.
  • Create domain-specific modules: It would be beneficial to develop reusable modules for game play, data visualization, e-commerce, and other domains.
  • Build out the showcases and examples: The site is continually soliciting showcases and examples.
  • Identify areas for ongoing R&D: While most of the effort in the AJAX3D project will be focused on deployment, there are some areas that require further research. For example, is it possible to deliver real-time messages for multi-user game play using AJAX, or are other technologies required?
  • Engage with the industry: Develop relationships and begin conversations with other groups involved in AJAX and Web 3D development, both official and ad hoc.
Summary
Royalty-free standards such as X3D have made it possible for anyone to deliver rich 3D content in real-time over the Internet. At the same time, AJAX has emerged as a worldwide phenomenon and unleashed a flurry of new application development. By bringing these two technologies together, AJAX3D promises a complete open platform for creating a next-generation 3D Web experience.

With AJAX3D immersive virtual worlds can be deployed in a Web browser and integrated with pages and other media. AJAX3D worlds can communicate with standard Web servers using XML and AJAX technologies, enabling professional, scalable, industrial-strength applications with high production value and visual impact.

AJAX3D is in its infancy. In the coming months it will need to be nurtured and actively developed. Media Machines hopes that the initiative that began at www.ajax3d.org will take on a life of its own and become a worldwide forum for researching and developing this exciting new technology.

More Stories By Tony Parisi

Tony Parisi, president and CEO of Media Machines, is a technology pioneer and accomplished entrepreneur. He is co-creator of the Virtual Reality Modeling Language (VRML), the ISO standard for 3D graphics on the World Wide Web, and is widely recognized as an expert in standards, technologies, and emerging markets for interactive rich media. In 1995 Tony founded Intervista Software, an early innovator in real-time, networked 3D graphics technology and developed WorldView, the first real-time VRML viewer for Microsoft Windows. In 1998 Intervista was purchased by PLATINUM technology, inc., and Tony joined the company to lead business affairs for its 3D visualization group. Tony founded Media Machines in 2001 and is spearheading the development of FLUX, a real-time 3D technology that continues to push the envelope in interactive graphics for the Web. He is also a lead editor and co-chair of the Extensible 3D (X3D) Specification, the new standard for Web3D graphics being developed by the Web3D Consortium.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.