Full HTML for

Basic foilset VRML 2 Scripting -- Java JavaScript VRMLScript

Given by Balaji Natarajan(Geoffrey C. Fox) at CPS616 -- Information Track of CPS on Spring Semester 97. Foils prepared April 15 1997
Outside Index Summary of Material


See VRML Resources including many interesting examples
Basic Concepts of Scripting in VRML2
Java JavaScript VRMLScript as Scripting Languages
VRML Database Connectivity

Table of Contents for full HTML of VRML 2 Scripting -- Java JavaScript VRMLScript

Denote Foils where Image Critical
Denote Foils where HTML is sufficient
denotes presence of Additional linked information which is greyed out if missing

1 CPS 616 Spring 97 Computational Science for the Information Applications
2 Scripts and Execution Model in VRML 2.0
3 Concepts in Script Nodes
4 Script Nodes in Java for VRML 2.0
5 Why Java with VRML ?
6 Why VRML with Java ?
7 Methods of Java-VRML interaction
8 VRML 2.0 Browsers with Java support
9 Java class referencing a VRML file
10 Sample VRML file referenced by a Java class - I
11 Sample VRML file referenced by a Java class - II
12 Sample VRML file referenced by a Java class - III
13 Java code to set an eventOut field - I
14 Java code to set an eventOut field - II
15 Simple VRML world controlled by Java
16 Advanced applications of Java - VRML 2.0 interaction
17 VRML worlds in which Java dynamically creates nodes - I
18 VRML world in which Java dynamically creates nodes - II
19 VRML world in which Java dynamically creates nodes - III
20 Java class to dynamically generate VRML 2.0 nodes at runtime - I
21 Java class to dynamically generate VRML 2.0 nodes at runtime - II
22 Java class to dynamically generate VRML 2.0 nodes at runtime - III
23 Java class to dynamically generate VRML 2.0 nodes at runtime - IV
24 Dynamic Generation of VRML 2.0 nodes at runtime - V
25 VRML world in which Java dynamically creates routes - I
26 VRML world in which Java dynamically creates routes - II
27 VRML world in which Java dynamically creates routes - III
28 Java class to dynamically generate VRML 2.0 routes at runtime - I
29 Java class to dynamically generate VRML 2.0 routes at runtime - II
30 Dynamic Generation of VRML 2.0 routes at runtime - III
31 A behavioral world with superior sound-effects using Java-VRML 2.0 interaction - I
32 A behavioral world with superior sound-effects using Java-VRML 2.0 interaction - II
33 A behavioral world with superior sound-effects using Java-VRML 2.0 interaction - III
34 A behavioral world with superior sound-effects using Java-VRML 2.0 interaction - IV
35 A behavioral world with superior sound effects using Java-VRML 2.0 interaction - V
36 A behavioral world with superior sound effects using Java-VRML 2.0 interaction - VI
37 A behavioral world with superior sound effects using Java-VRML 2.0 interaction - VII
38 A behavioral world with superior sound-effects using Java-VRML 2.0 interaction - VIII
39 Collaborative virtual environments - I
40 Collaborative Virtual Environments - II
41 A Sample Collaborative Virtual Environment -Virtual Theater
42 VRML & JavaScript Interaction
43 Examples of JavaScript-VRML interaction
44 VRML-JavaScript Interaction to create custom interpolator nodes
45 VRML world in which JavaScript creates custom interpolator nodes
46 VRML world in which JavaScript creates custom interpolator nodes - II
47 JavaScript source to create custom interpolator nodes in VRML world
48 Creation of custom interpolator VRML 2.0 nodes using JavaScript - III
49 Creation of virtual 3-D radio buttons using JavaScript
50 VRML world with Inline JavaScript source... I
51 VRML world with inline JavaScript source - II
52 VRML world with inline JavaScript source - III
53 VRML world with inline JavaScript source - IV
54 VRML world with inline JavaScript source - V
55 VRML world with inline JavaScript source - VI
56 VRML world with virtual radio buttons
57 Parameter passing from Web page to VRML world using JavaScript
58 VRML & VrmlScript Interaction
59 Script Nodes in VrmlScript
60 VRML world controlled by an inline VrmlScript source - I
61 VRML world controlled by an inline VrmlScript source - II
62 VRML world controlled by an inline VrmlScript source - III
63 VRML world controlled by an inline VrmlScript source - IV
64 VRML world controlled by an inline VrmlScript source - V
65 Simple VRML world controlled by a VrmlScript source
66 Netscape's LiveConnect Architecture
67 External Authoring Interfaces(EAI) for VRML 2.0 -I
68 External Authoring Interfaces (EAI) for VRML 2.0 - II
69 Recent Developments in the VRML industry
70 Binary Format for a VRML file
71 Database Connectivity for VRML - I
72 Database Connectivity for VRML - II
73 Database Connectivity for VRML - III

Outside Index Summary of Material



HTML version of Basic Foils prepared April 15 1997

Foil 1 CPS 616 Spring 97 Computational Science for the Information Applications

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
Scripting in VRML 2.0
and Other Recent Developments
Presented: Geoffrey Fox
NPAC
Syracuse University
111 College Place
Syracuse NY 13244-4100

HTML version of Basic Foils prepared April 15 1997

Foil 2 Scripts and Execution Model in VRML 2.0

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
Script Nodes essentially give logic and state management to a VRML world.
Key feature of the execution model is that time advances in a VRML 2.0 scene in virtual units
Each time unit in the scene has an associated time value , called a timestamp.
Start of an Event Cascade signifies creation of a timestamp and attaching it to an event.

HTML version of Basic Foils prepared April 15 1997

Foil 3 Concepts in Script Nodes

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
Scripting languages supported currently by VRML 2.0 are Java, JavaScript and VrmlScript.
User-defined fields in Script Nodes provide the link between the state in VRML scene and state in the Java/JavaScript/VrmlScript program.
Events arriving at an eventIn field automatically cause the browser to pass the event to the program referred to in the url field of the Script node. This mechanism is called Event Dispatching.

HTML version of Basic Foils prepared April 15 1997

Foil 4 Script Nodes in Java for VRML 2.0

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
Java nodes make use of VRML 2.0 Java API attached to VRML 2.0 specifications.
Typical fields in a Java script node are :
eventIn - for getting the actual event in the VRML world
eventOut - for sending results generated by Java Class
url - this field specifies the location of the Java class
field - this defines fixed parameters

HTML version of Basic Foils prepared April 15 1997

Foil 5 Why Java with VRML ?

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
The blending of Java and VRML enables true multimedia ,experiential and dynamic content on the Web.
Both Java and VRML are cross - platform standards.
The powerful networking classes of Java can be optimally used with VRML to provide for Collaborative virtual environments.

HTML version of Basic Foils prepared April 15 1997

Foil 6 Why VRML with Java ?

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
VRML with Java is a powerful combination that results in executable content, optimized for today's low bandwidth environments.
Simple 3-D programming of complex front-ends possible using well-defined nodes in VRML 2.0 specifications.
Substantial bandwidth savings possible by using a VRML world animated by a Java applet - rather than a 2D GIF/JPEG image animated by Java.
  • As send short VRML definition of "image" rather than image itself. Of course one has increased compute time to render image!

HTML version of Basic Foils prepared April 15 1997

Foil 7 Methods of Java-VRML interaction

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
In VRML 2.0, Script nodes allows to fashion nodes that are described by Java classes using the VRML 2.0 Java API.
The whole VRML browser can be written in Java - having a set of Java classes that implement the VRML specifications - as in DimensionX's Liquid Reality browser.
Using Netscape's LiveConnect architecture,a VRML world can be controlled by a Java applet.

HTML version of Basic Foils prepared April 15 1997

Foil 8 VRML 2.0 Browsers with Java support

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
Sony's Community Place
SGI's CosmoPlayer
DimensionX's Liquid Reality
IICM's VRWave
OzVirtual Browser

HTML version of Basic Foils prepared April 15 1997

Foil 9 Java class referencing a VRML file

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
This class will extend the Script class defined in the vrml package - a part of the VRML 2.0 Java API.
Contains an initialize method for getting eventOuts and exposedFields from the VRML file.
Contains a processEvent method for getting details about the event and processing it.
Contains a shutdown method - this method is automatically called when Script node is deleted.

HTML version of Basic Foils prepared April 15 1997

Foil 10 Sample VRML file referenced by a Java class - I

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
Description of the Example world :
This is a simple VRML world to illustrate the idea of scripting using Java.This world consists of a sphere object with a touchSensor associated with it. On clicking the sphere,through Scripting, the color of the sphere is changed.

HTML version of Basic Foils prepared April 15 1997

Foil 11 Sample VRML file referenced by a Java class - II

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
#VRML V2.0 utf8
Transform {
children [ DEF TS TouchSensor {}
Shape { appearance Appearance {
material DEF SphereColor material {diffuseColor100}
} # End Appearance
geometry Sphere {}
} ] }

HTML version of Basic Foils prepared April 15 1997

Foil 12 Sample VRML file referenced by a Java class - III

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
DEF ColorScript Script {
url "ChangeColor.class"
eventIn SFBool clicked
eventOut SFColor newColor
field SFBool on FALSE }
ROUTE TS.isActive TO ColorScript.clicked
ROUTE ColorScript.newColor TO SphereColor.set_diffuseColor

HTML version of Basic Foils prepared April 15 1997

Foil 13 Java code to set an eventOut field - I

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
Public class Changecolor extends Script {
private SFColor newColor ;
float red[] = {1,0,0};
public void initialize() {
newColor = (SFColor)
getEventOut ("newColor");
}

HTML version of Basic Foils prepared April 15 1997

Foil 14 Java code to set an eventOut field - II

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
Public void processEvent(Event e) {
ConstSFBool v = (ConstSFBool)e.getValue();
if(v.getValue()) {
if(on.getValue()) {
newColor.setValue(red);
} else { newColor.setValue(blue);
}
on.setValue(!on.getValue()); } } }

HTML version of Basic Foils prepared April 15 1997

Foil 15 Simple VRML world controlled by Java

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
changecolor.wrl(requires Community Place Plug-in on PC)
http://king.syr.edu:2006/src/public_html/InteractiveDemos/java/changecolor.wrl

HTML version of Basic Foils prepared April 15 1997

Foil 16 Advanced applications of Java - VRML 2.0 interaction

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
Dynamic Generation of VRML 2.0 nodes at Runtime.
Dynamic Generation of VRML 2.0 routes at Runtime.
Behavioral worlds coupled with DirectSound effects to achieve realism.
Collaborative Virtual Environments like Virtual Theaters,Shopping Malls.

HTML version of Basic Foils prepared April 15 1997

Foil 17 VRML worlds in which Java dynamically creates nodes - I

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
Description of the world :
This world initially consists of a sphere object with a touchSensor associated with it. On clicking the Sphere, an entire new node is generated at runtime and is displayed near the existing Sphere.Now the new Sphere can be clicked upon to generate another node.

HTML version of Basic Foils prepared April 15 1997

Foil 18 VRML world in which Java dynamically creates nodes - II

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
#VRML V2.0 utf8
DEF GEN_ROOT Transform{
children [ DEF GEN_TOUCH TouchSensor {}
Shape {geometrySphere{} } ] }
DEF GEN_SCRIPT Script {
url "DynamicGen.class"
eventIn SFTime touched
eventOut MFNode addSphere }

HTML version of Basic Foils prepared April 15 1997

Foil 19 VRML world in which Java dynamically creates nodes - III

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
ROUTE GEN_TOUCH.touchTime TO
GEN_SCRIPT.touched
ROUTE GEN_SCRIPT.addSphere TO
GEN_ROOT.addChildren

HTML version of Basic Foils prepared April 15 1997

Foil 20 Java class to dynamically generate VRML 2.0 nodes at runtime - I

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
Public class DynamicGenerator extends Script {
MFNode addSphere ;
Random randomNumGenerator = new Random();
float posX = 0.0f;
public void initialize() {
addSphere = (MFNode)getEventOut("addSphere"); }

HTML version of Basic Foils prepared April 15 1997

Foil 21 Java class to dynamically generate VRML 2.0 nodes at runtime - II

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
public void processEvent(Event e) {
String sphereDesc1 = "Transform { translation 0.0 0.0 0..0 ";
String sphereDesc2 = "children[ Shape geometry Sphere{}";
String sphereDesc3 = "appearance Appearance { material Material ";
String sphereDesc4 = "diffuseColor 1.0 0.0 0.0 } } } ] } ";

HTML version of Basic Foils prepared April 15 1997

Foil 22 Java class to dynamically generate VRML 2.0 nodes at runtime - III

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
Float red = randomNumGenerator.nextFloat();
float green = randomNumGenerator.nextFloat();
float blue = randomNumGenerator.nextFloat();
Browser browser = getBrowser();
BaseNode baseNodes[];
posX += 3.0f ; // X coordinate of new node.

HTML version of Basic Foils prepared April 15 1997

Foil 23 Java class to dynamically generate VRML 2.0 nodes at runtime - IV

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
try {
baseNodes[0] = browser.createVrmlFromString(sphereDesc1+
sphereDesc2+sphereDesc3+sphereDesc4);
addSphere.setValue(baseNodes[0]);
}
catch(Exception ex) { ex.printStackTrace() ;
} } } }

HTML version of Basic Foils prepared April 15 1997

Foil 24 Dynamic Generation of VRML 2.0 nodes at runtime - V

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
DynamicGen.wrl(requires Community Place Plug-in on PC)
http://king.syr.edu:2006/src/public_html/InteractiveDemos/java/DynamicGen.wrl

HTML version of Basic Foils prepared April 15 1997

Foil 25 VRML world in which Java dynamically creates routes - I

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
Description of the world :
This world consists of a cone object and a sphere object.The Cone functions as an ON/OFF switch for route creation.When the cone is clicked initially,it means the world is ready for a route to be created - then click on the sphere - a route is dynamically created between the touchSensor and the lighting node.

HTML version of Basic Foils prepared April 15 1997

Foil 26 VRML world in which Java dynamically creates routes - II

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
#VRML V2.0 utf8
Transform { children [
DEF RouteSwitch TouchSensor {}
Shape {geometryCone{} } ] }
Transform { translation 3 0 0 children [
DEF LightSwitch TouchSensor {}
Shape {geometrySphere{} }
] }

HTML version of Basic Foils prepared April 15 1997

Foil 27 VRML world in which Java dynamically creates routes - III

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
DEF DL DirectionalLight {onFALSE}
NavigationInfo {headlightFALSE}
DEF SC Script {
url "AddRoute.class"
field SFNode lightswitch USE LightSwitch
field SFNode dl USE DL
eventIn SFTime touched }
ROUTE RouteSwitch.touchTime TO SC.touched

HTML version of Basic Foils prepared April 15 1997

Foil 28 Java class to dynamically generate VRML 2.0 routes at runtime - I

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
Public class AddRoute extends Script {
private boolean routed = false;
Browser b;
Node lightswitch,dl;
public void initialize() {
b = getBrowser();
dl = (Node)((SFNode)getField("dl")).getValue();

HTML version of Basic Foils prepared April 15 1997

Foil 29 Java class to dynamically generate VRML 2.0 routes at runtime - II

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
lightswitch = (Node)((SFNode)getField("lightswitch")).
getValue(); }
Public void processEvent(Event e) {
if(routed) {b.deleteRoute(lightswitch,"isActive",dl,"on");}
else {b.addRoute(lightswitch,"isActive",dl,"on");}
routed = !routed; } }

HTML version of Basic Foils prepared April 15 1997

Foil 30 Dynamic Generation of VRML 2.0 routes at runtime - III

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
addRoute.wrl(requires Community Place Plug-in on PC)
http://king.syr.edu:2006/src/public_html/InteractiveDemos/java/addRoute.wrl

HTML version of Basic Foils prepared April 15 1997

Foil 31 A behavioral world with superior sound-effects using Java-VRML 2.0 interaction - I

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
Description of the world:
This world consists of a virtual Honey bee hive. As the Beehive is approached closer, the bees jump out of the hive with buzzing noises. Full use of sound spatialization is made by making the buzzing sound node reside in the same hierarchial level as the node which constructs the bee.

HTML version of Basic Foils prepared April 15 1997

Foil 32 A behavioral world with superior sound-effects using Java-VRML 2.0 interaction - II

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
#VRML2.0 utf8
PROTO BEEBEE[
eventIn SFVec3f positionChanged
eventIn SFRotation orientationChanged
eventIn SFBool isActive
eventIn SFTime BeeTimeSensorCycleTime
]

HTML version of Basic Foils prepared April 15 1997

Foil 33 A behavioral world with superior sound-effects using Java-VRML 2.0 interaction - III

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
Transform {
children [
DEF BeeTransform Transform {
children[ DEF BeeSound Sound {
source AudioClip {url "sounds/beebee.wav"
loop TRUE }
maxFront 17.3205
maxBack 17.3205

HTML version of Basic Foils prepared April 15 1997

Foil 34 A behavioral world with superior sound-effects using Java-VRML 2.0 interaction - IV

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
} Inline {url"models/bee.wrl"} ] }
DEF MainScript Script {
url "scripts/Beebee.class"
eventIn SFVec3f PositionChanged IS positionChanged
eventIn SFRotation OrientationChanged IS orientationChanged
eventIn SFBool HoneycomTouchSensorIsActive IS isActive
eventIn SFTime BeeTimeSensorCycleTime IS
BeeTimeSensorCycleTime
eventOut SFVec3f BeeTranslation
eventOut SFRotation BeeRotation } ]

HTML version of Basic Foils prepared April 15 1997

Foil 35 A behavioral world with superior sound effects using Java-VRML 2.0 interaction - V

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
ROUTE MainScript.BeeTranslation TO BeeTransform.set_translation
ROUTE MainScript.BeeRotation TO BeeTransform.set_rotation
}
}
DEF BeeTimeSensor TimeSensor {
loop TRUE
enabled TRUE
stopTime -1
cycleInterval 0.1 }

HTML version of Basic Foils prepared April 15 1997

Foil 36 A behavioral world with superior sound effects using Java-VRML 2.0 interaction - VI

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
DEF HoneyCom Transform {
children [ DEF HoneycomProximitySensor
ProximitySensor size 100 100 100 }
DEF HoneycomTouchSensor TouchSensor{}
Transform { translation 0 -1 0
children [ Shape { appearance Appearance{
texture ImageTexture " honeycom.jpg"
} } geometry Sphere{radius3} } ] }] }

HTML version of Basic Foils prepared April 15 1997

Foil 37 A behavioral world with superior sound effects using Java-VRML 2.0 interaction - VII

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
DEF Beebee1 BEEBEE {}
ROUTE HoneycomProximitySensor.position_changed TO
Beebee1.positionChanged
ROUTE HoneycomProximitySensor.orientation_changed TO
Beebee1.orientationChanged
ROUTE HoneycomTouchSensor.isActive TO Beebee1.isActive
ROUTE BeeTimeSensor.cycleTime TO
Beebee1.BeeTimeSensorCycleTime

HTML version of Basic Foils prepared April 15 1997

Foil 38 A behavioral world with superior sound-effects using Java-VRML 2.0 interaction - VIII

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
beebee.wrl(requires Community Place Plug-in on PC)
http://king.syr.edu:2006/src/public_html/InteractiveDemos/java/beebee/main.wrl

HTML version of Basic Foils prepared April 15 1997

Foil 39 Collaborative virtual environments - I

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
Made possible using Java's powerful networking classes
Users represented as Avatars in shared spaces.
Concept of Shared Behaviors has to be implemented to achieve realism in these environments.

HTML version of Basic Foils prepared April 15 1997

Foil 40 Collaborative Virtual Environments - II

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
The visual element of a shared environment also provides a vehicle for enhancing the tools available in a workplace , such as scientific data visualization and process simulation
For example , a team of engineers who design an aerospace engine by testing different parts online from different locations can benefit from a display of results that show cause and effect relationships in a multi-user space.

HTML version of Basic Foils prepared April 15 1997

Foil 41 A Sample Collaborative Virtual Environment -Virtual Theater

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
Theater.wrl(requires Community Place Plug-in on PC)
http://king.syr.edu:2006/src/public_html/InteractiveDemos/Multi-User/theater/main.wrl

HTML version of Basic Foils prepared April 15 1997

Foil 42 VRML & JavaScript Interaction

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
JavaScript allows for opening a document in a Web page using the plug-in type and to send commands directly to the plug-in/browser.
JavaScript allows for opening of a VRML 2.0 file in a different frame on the same Web page of which the other frame will contain the control information written in JavaScript
Similar scripting procedures like Java though collaborative applications are fairly difficult.

HTML version of Basic Foils prepared April 15 1997

Foil 43 Examples of JavaScript-VRML interaction

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
Creation of User-defined VRML 2.0 interpolator nodes.
Creation of Boolean Event-Filters enabling creation of virtual Radio-Buttons.
Parameter passing to VRML objects directly from
Web pages.

HTML version of Basic Foils prepared April 15 1997

Foil 44 VRML-JavaScript Interaction to create custom interpolator nodes

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
Description of the world:
Animation of a red sphere - located relatively higher than a white board - is done using javascript. The sphere will continue to move for 4 virtual time units(as set in the world file) and then return to its origin and then start to move again....

HTML version of Basic Foils prepared April 15 1997

Foil 45 VRML world in which JavaScript creates custom interpolator nodes

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
#VRML V2.0 utf8
Group { children [
Background [ # Node for background representation
. . . . . . . . . . . . . ]
Shape { # Node for floor representation
. . . . . . . . . . . . . .]
Transform { # Node for red ball representation
. . . . . . . . . . . . . .}
DEF Clock AnimationSensor {....} # Animation Clock

HTML version of Basic Foils prepared April 15 1997

Foil 46 VRML world in which JavaScript creates custom interpolator nodes - II

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
DEF Mover Script {
url "move1.js "
eventIn SFFloat set_fraction
eventOut SFVec3f value_changed
} ] }
ROUTE Clock.fraction_changed TO Mover.set_fraction
ROUTE Mover.value_changed TO BallTransform.
set_translation

HTML version of Basic Foils prepared April 15 1997

Foil 47 JavaScript source to create custom interpolator nodes in VRML world

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
// Function to move a shape in a straight path
function set_fraction(fraction, eventTime )
{
value_changed[0] = fraction; // X component
value_changed[1] = 0.0; // Y component
value_changed[2] = 0.0; // Z component
}

HTML version of Basic Foils prepared April 15 1997

Foil 48 Creation of custom interpolator VRML 2.0 nodes using JavaScript - III

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
moveball.wrl
http://king.syr.edu:2006/src/public_html/InteractiveDemos/js/moveball.wrl

HTML version of Basic Foils prepared April 15 1997

Foil 49 Creation of virtual 3-D radio buttons using JavaScript

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
Description of the world:
Custom shapes like cube,sphere,box are converted into radio-buttons by providing them with typical functionalities like background color changing. These functionalities can be extensively extended to create a complete virtual 3-D Graphical User Interface(GUI).

HTML version of Basic Foils prepared April 15 1997

Foil 50 VRML world with Inline JavaScript source... I

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
#VRML V2.0 utf8
Group { children [
# Bindable Backgrounds (cyan,red,blue)
DEF Back1 Background {........}
DEF Back2 Background {........}
DEF Back3 Background {........}
# Shapes to act as Radio - Buttons to control Backgrounds
Transform {children[......geometryBox{}
DEF BackButton1 TouchSensor{} ] }

HTML version of Basic Foils prepared April 15 1997

Foil 51 VRML world with inline JavaScript source - II

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
Transform {children[......geometrySphere{}
DEF BackButton2 TouchSensor {} ] }
Transform {children[......geometryCone{}
DEF BackButton3 TouchSensor {} ] }

HTML version of Basic Foils prepared April 15 1997

Foil 52 VRML world with inline JavaScript source - III

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
# The inline JavaScript source
DEF Filter1 Script { #code for I filter
url "javascript:
function set_boolean(bool,eventTime) {
if(bool = = true) {true_changed=true;}
else {false_changed=true;}
eventIn SFBool set_boolean
eventIn SFBool true_changed
eventIn SFBool false_changed }

HTML version of Basic Foils prepared April 15 1997

Foil 53 VRML world with inline JavaScript source - IV

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
DEF Filter2 Script { #code for II filter
url "javascript:
function set_boolean(bool,eventTime) {
if(bool = = true) {true_changed=true;}
else {false_changed=true;}
eventIn SFBool set_boolean
eventIn SFBool true_changed
eventIn SFBool false_changed }

HTML version of Basic Foils prepared April 15 1997

Foil 54 VRML world with inline JavaScript source - V

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
DEF Filter3 Script { #code for III filter
url "javascript:
function set_boolean(bool,eventTime) {
if(bool = = true) {true_changed=true;}
else {false_changed=true;}
eventIn SFBool set_boolean
eventIn SFBool true_changed
eventIn SFBool false_changed }

HTML version of Basic Foils prepared April 15 1997

Foil 55 VRML world with inline JavaScript source - VI

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
Route BackButton1.isActive TO Filter1.set_boolean
Route BackButton2.isActive TO Filter2.set_boolean
Route BackButton3.isActive TO Filter3.set_boolean
Route Filter1.true_changed TO Back1.set_bind
Route Filter2.true_changed TO Back2.set_bind
Route Filter3.true_changed TO Back3.set_bind

HTML version of Basic Foils prepared April 15 1997

Foil 56 VRML world with virtual radio buttons

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
radiobuttons.wrl
http://king.syr.edu:2006/src/public_htmL/InteractiveDemos/js/radiobuttons.wrl

HTML version of Basic Foils prepared April 15 1997

Foil 57 Parameter passing from Web page to VRML world using JavaScript

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
cylinder.wrl
http://www.npac.syr.edu/users/zeynep/VRML2.0_EXAMPLES/hasan/Cylinder/main..html

HTML version of Basic Foils prepared April 15 1997

Foil 58 VRML & VrmlScript Interaction

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
VrmlScript is a subset of the JavaScript language with VRML data types supported as JavaScript built-in objects.
Scripts can be included in source form, inline rather than in a separate URL.
Receiving eventIns is handled with separate functions to ease development and to speed up processing.

HTML version of Basic Foils prepared April 15 1997

Foil 59 Script Nodes in VrmlScript

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
The url field of the Script Node may contain a URL that references the VrmlScript code
Script {url"http://foo.com/myScript.vs"}
The script can also be placed inline as
Script {url"vrmlscript:functionfoo(){...} " }
The url field may contain multiple URL's and thus reference a remote line or in-line code.

HTML version of Basic Foils prepared April 15 1997

Foil 60 VRML world controlled by an inline VrmlScript source - I

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
Description of the world :
There are two box objects present in the scene. Clicking on the blue box object animates the red box object for a fixed time period. The animation is controlled by an inline vrmlscript source within the world file.

HTML version of Basic Foils prepared April 15 1997

Foil 61 VRML world controlled by an inline VrmlScript source - II

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
#VRML V2.0 utf8
Transform { children [
DEF TIME1 TimeSensor {cycleInterval10}
DEF INTERP1 PositionInterpolator {
key [ 0.0 0.5 1.0 ]
keyValue [ .15 .15 0 .15 -.15 0 .15 .15 0 ]
} DEF T1 Transform {.....geometryBox{..} }
// Node definition for box to be animated.

HTML version of Basic Foils prepared April 15 1997

Foil 62 VRML world controlled by an inline VrmlScript source - III

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
Transform {children[DEFGOTouchSensor{}
Shape {...geometryBox{..} ] }
// Node definition of animating box
// The inline VrmlScript source
DEF JUMPY Script {
eventIn SFFloat smooth_in
eventOut SFFloat jumpy_out
url "vrmlscript:

HTML version of Basic Foils prepared April 15 1997

Foil 63 VRML world controlled by an inline VrmlScript source - IV

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
Function smooth_in(t)
{ step = (t*10) % 5;
jumpy_out = step/10.0; } "
DEF SCRIPT Script {
eventIn SFTime clicked
eventOut SFTime start1
url "vrmlscript : function clicked(time)
{start1=time;} "

HTML version of Basic Foils prepared April 15 1997

Foil 64 VRML world controlled by an inline VrmlScript source - V

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
ROUTE TIME1.fraction_changed TO
JUMPY.smooth_in
ROUTE JUMPY.jumpy_out TO
INTERP1.set_fraction
ROUTE INTERP1.value_changed TO
T1.translation
ROUTE GO.touchTime TO SCRIPT.clicked
ROUTE SCRIPT.start1 TO TIME1.startTime

HTML version of Basic Foils prepared April 15 1997

Foil 65 Simple VRML world controlled by a VrmlScript source

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
jumper.wrl
http://king.syr.edu:2006/src/public_html/InteractiveDemos/vs/jumper.wrl

HTML version of Basic Foils prepared April 15 1997

Foil 66 Netscape's LiveConnect Architecture

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
VRML worlds are accessible through Java using a plug-in API that employs Netscape's LiveConnect Architecture.
Java applets loaded on a HTML page can trigger events in a VRML world loaded in a different frame in the same page.
VRML 2.0 Browser currently employing the LiveConnect architecture is Live3D browser on the PC's.

HTML version of Basic Foils prepared April 15 1997

Foil 67 External Authoring Interfaces(EAI) for VRML 2.0 -I

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
EAI is one other way in which Java can interact with VRML.
From a Java programmer's point of view, EAI is a set of classes with methods that can be called to control the VRML world.
From a VRML world creator's point of view, the EAI is just another mechanism that can send and receive events.

HTML version of Basic Foils prepared April 15 1997

Foil 68 External Authoring Interfaces (EAI) for VRML 2.0 - II

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
Processes happening when a Java applet changes the color of a Sphere node in a VRML world :
The applet makes a call to find the sphere by asking for it by name.
Next, the applet will make a call to change the color of that field.
When the applet finds the color field and changes the color of that field, the VRML world receives and event - processes it and finally changes color.

HTML version of Basic Foils prepared April 15 1997

Foil 69 Recent Developments in the VRML industry

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
Compressed Binary Format for VRML 2.0 file to be introduced.
Database Connectivity for VRML files to be established in the near future.

HTML version of Basic Foils prepared April 15 1997

Foil 70 Binary Format for a VRML file

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
Currently in the development stage
Results in reduced file size - Clever Compression routines can result in the reduction of a VRML file size by 40 percent.
Reduced Load Time - A binary file format is better suited for efficient parsing because it contains the minimum data needed by the browser to build scenes.
Increased degree of security .

HTML version of Basic Foils prepared April 15 1997

Foil 71 Database Connectivity for VRML - I

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
VRML Database API is now currently in the development stage.
The objective in developing this API is to define a standard for Data Repositories - a generic mechanism for storing and accessing VRML data that supports modifying existing world content , distributing world information and managing world access.

HTML version of Basic Foils prepared April 15 1997

Foil 72 Database Connectivity for VRML - II

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
The VRML Database API would essentially address the following issues :
Persistence : While VRML 2.0 describes worlds that change over time and respond to user actions, the world always begins at a fixed unchanging state. Any changes a user makes to objects in the world are reset the next time the world is entered. The API would support locks , contention management, retrieval of a scene graph

HTML version of Basic Foils prepared April 15 1997

Foil 73 Database Connectivity for VRML - III

From VRML 2 Scripting -- Java JavaScript VRMLScript CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
Scalability : The API would support optimized, streamed delivery of custom VRML content based on user criteria defined via spatial and logical partitioning.
Security : The API would support user privileges, authorization and object ownership inside the virtual world.

© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Thu Aug 14 1997