Extending VRML 2 with Java

1 of 6  

To me, VRML has two distinct purposes: To provide a pleasing architecture to 3D cyberspace and to provide educational and entertaining things to do within the confines of that architecture. Consider a virtual pool hall. VRML 1, as a standard, provides all the tools necessary to build an attractive and functional billiards room complete with marble floors, colorful walls, impressive artwork, cozy lighting and smoky haze. 

But, visiting a virtual billiards parlor eventually loses its charm if there are no billiards to play. So, VRML 2 provides the context within which balls, racks, cues and chalk can be created and manipulated. Sensors, Timers, Interpolators, ROUTES and VRMLscript provide a primitive interface for making a pool hall respond to a virtual visitor’s actions. But, as this article discusses, Java provides a more flexible yet more complicated tool for making a pool table come to life. Interpolators are great, but they must be pre-loaded with all of the possible behaviors that might take place in a world without the help of a programming language. 

I enjoy creating visual 3D objects, embedding their physics and letting them interact without any additional human intervention. Consider 16 billiard balls behaving naturally in response to a single human-initiated event: a cue stick striking a cue ball. That’s great stuff. Java makes such self-responding worlds possible. If you believe in the ability of Java to make your worlds come to life, you are halfway to making it happen. To get three-quarters of the way there, you have to choose how to add Java to your world. Then, of course, you have to learn how to program using Java. 

I have given a lot of thought about how to add Java to my worlds. VRML gives us a new toy we have never had before: The ability to share visual 3D objects through Web servers located all around the planet. Although as planetary citizens we have barely taken advantage of this opportunity, it would be nice to continue to keep the dream alive and place Java code within the confines of each VRML object. The VRML 2 standards committee continues to pursue an approach to standardizing the way Java code self-contains itself within each 3D object in the VRML scene graph. Just as I can share VRML geometries with others on the Web using VRML with an intranode Java programming style, I can share behaviors with others as well since an object’s behavior is self-contained in its Transform node. Imagine how quickly 3D cyberspace could come to life if each VRML author spent time studying and creating a different 3D object and made it available on the Web. With 500 or so interesting and naturally behaving 3D objects available, all VRML authors could put together sophisticated content in much shorter periods of time. 

Intranode Java certainly shows long-term promise and should deliver the kind of 3D cyberspace many of us envision. Keep up with the latest work of the VRML Consortium to see intranode Java progress. This article, on the other hand, focuses on adding Java through an External Authoring Interface (EAI). I use the EAI to create my virtual pool halls, virtual solar systems and virtual board games. In this article I demonstrate using the EAI to create a virtual kaleidoscope. The virtual kaleidoscope project shows a good balance of using VRML 2 and Java, each for its intended purpose. 

1 of 6  

Copyright 1998 by SYS-CON Publications, Inc. 
VRMLJournal.com