Ajax3D: The Open Platform for Rich 3D Web Applications
Tony Parisi Media Machines, Inc. August, 2006
Introduction
Real-time 3D is emerging as a first-class media type for the web. Network bandwidth and graphics hardware processing power are now sufficiently advanced to enable compelling webbased 3D experiences, including games, online virtual worlds, simulations, education and training. Commercial developers are expressing increasing interest in exploiting real-time 3D in web applications to enhance production value, create engaging immersive experiences, and deliver information in a more meaningful way. Much of the infrastructure has been put into place to enable professional Web 3D deployment in a cross-platform, open, royalty-free environment. Interoperability standards such as ISO standard Extensible 3D Graphics (X3D) are now mature, fully functional and robust, and supported by multiple open source implementations and affordable production pipelines. However, those technologies only go so far, in that they are focused on the transportability of embedded rich content, and not on the applications that embed it. The industry is in need of a rapid development environment for creating scalable, highly interactive client-server 3D applications on the web. Ajax – Asynchronous Javascript and XML—has emerged as a preferred method for developing sophisticated web applications. Ajax makes client-server programming available to Javascript developers via Dynamic HTML, resulting in rich, responsive applications hosted in a web browser. While Ajax is being used to deploy some of the industry’s leading applications, such as Google Maps™ and Netflix™, current browsers are limited in their capabilities to render dynamic content, in particular high performance real-time 3D.
Ajax3D combines the power of X3D, the standard for real-time 3D on the web, with the ease of use and ubiquity of Ajax. Ajax3D employs the X3D Scene Access Interface (SAI)—the X3D equivalent of the DOM— to control 3D worlds via Javascript. With the simple addition of an X3D plugin to today’s web browsers, we can bring the awesome power of video game technology to the everyday web experience. The initial development has begun. Media Machines has created the first showcase applications and tutorials, and has launched a web site, www.ajax3d.org, as an open industry forum to explore technologies, techniques and best practices. This white paper describes the key technical concepts behind Ajax3D and, via examples, introduces the beginning of a formal programming framework for general use.
Ajax3D Basics
Ajax3D is based on the integration of two programming models – the W3C Document Object Model (DOM) and the ISO Scene Access Interface (SAI). The DOM defines a model for programs interacting with a web document; the SAI allows programs to control X3D scenes. Javascript code running on a web page can interact with the DOM and the SAI simultaneously, enabling applications that integrate traditional 2D web page elements with the 3D world. Both the DOM and SAI are independent of any programming language; however our focus for Ajax3D is on Javascript. One DOM object is of particular interest to Ajax programmers: the XMLHttpRequest object. XMLHttpRequest allows a web application to make server requests without requiring the contents of the page to be refreshed. This capability is fundamental for creating dynamic, responsive applications that meet the expectation of today’s consumers. The SAI has a similar capacity in createX3DFromURL, a method of the X3D “browser” object that loads 3D content on demand. The combination of the DOM, SAI and XMLHttpRequest comprise the underpinnings of Ajax3D and in fact suggest the following precise definition of Ajax3D: An Ajax3D application is a web browser-hosted program that a. uses the SAI to access a real-time 3D scene b. uses the DOM to manipulate web page content in response to changes in the 3D scene, and c. uses server-request methods (XMLHttpRequest, createX3DFromURL) to store and retrieve data in response to, and/or leading to, changes in a 3D scene.
Embedding X3D Scenes in a Web Browser
The first step in creating an Ajax3D application is to create an HTML page that embeds X3D content. This is done using EMBED or OBJECT tags (the former being well supported in all web browsers), e.g.