The purpose of this article is to explain how to change the appearance of
some shapes as a result of the user clicking on one of them. This article
assumes that you are a beginning VRML developer.
VRML and JavaScript
One is a language used to describe 3D worlds while the other is the most
popular scripting method for the Internet. When you put these two together
you get a way to change the attributes of the virtual world as the result of
outside events. The new VRML 2.0 standard finally offers the VRML developer
avenues to create interactivity within the VRML world as a result of user
activity. This powerful and flexible ability is made possible by the new
Script node that basically allows the programmer to use code that does not
exist within the native VRML syntax.
For this article we will create a world that displays three primitive shapes.
A click of the mouse on... (more)