Table of Contents Previous Chapter Viewpoint Slideshow    Chapter Viewpoint Slideshow Next Chapter Viewpoint Slideshow X3D Resources

X3D Example Archives: VRML 2 Sourcebook, Chapter 30 - Scripts

[1] Figure30.1ScriptSlidingBall.x3d - sliding ball
Chapter Viewpoint Slideshow
Figure 30.4 Script Spiraling Ball Trace

Many actions are too complex for animation nodes, such as computed animation paths (e.g. gravity), algorithmic shapes (e.g. fractals), or collaborative environments (e.g. games). You can create new sensors, interpolators, etc., using program scripts written in Java (a powerful general-purpose language) or ECMAscript (JavaScript, an easy-to-learn language). The Script node selects a program script, specified by a url or contained source code. Program scripts have field and event interface declarations, each with a data type, a name, and an initial value (for fields only).

These X3D scenes are adapted directly from the original VRML 2.0 Sourcebook chapter examples. Also available: Introduction to VRML97 SIGGRAPH98 course notes.

5 X3D Scenes      15 Viewpoint Snapshots

Figure 30.1 Script Sliding Ball    
  [1] Figure30.1ScriptSlidingBall.x3d - sliding ball

  [2] Figure30.1ScriptSlidingBall.x3d - (default X3D view from 0 0 10)


Figure 30.2 Script Background Select    
  [3] Figure30.2ScriptBackgroundSelect.x3d - Background select

  [4] Figure30.2ScriptBackgroundSelect.x3d - (default X3D view from 0 0 10)


Figure 30.3 Script Sound Activate    
  [5] Figure30.3ScriptSoundActivate.x3d - toggle sound by clicking ball

  [6] Figure30.3ScriptSoundActivate.x3d - move left spatialize right

  [7] Figure30.3ScriptSoundActivate.x3d - move right spatialize left

  [8] Figure30.3ScriptSoundActivate.x3d - outside maximum attenuation ellipsoid

  [9] Figure30.3ScriptSoundActivate.x3d - (default X3D view from 0 0 10)


Figure 30.4 Script Spiraling Ball Trace    
  [10] Figure30.4ScriptSpiralingBallTrace.x3d - spiraling ball

  [11] Figure30.4ScriptSpiralingBallTrace.x3d - view from above

  [12] Figure30.4ScriptSpiralingBallTrace.x3d - side view

  [13] Figure30.4ScriptSpiralingBallTrace.x3d - (default X3D view)


Figure 30.5 Script Torus Builder    
  [14] Figure30.5ScriptTorusBuilder.x3d - Torus

  [15] Figure30.5ScriptTorusBuilder.x3d - (default X3D view from 0 0 10)

 

This viewpoint slideshow is online at
http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter30-Scripts/viewpointSlideshow.html

Validate XHTML 1.1

Viewpoint image version history at
http://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter30-Scripts/_viewpoints

Table of Contents Previous Chapter Viewpoint Slideshow    Chapter Viewpoint Slideshow Next Chapter Viewpoint Slideshow X3D Resources