------------------------------------------------------------------- Subject: 11. YOUR FIRST VRML SCENE ------------------------------------------------------------------- TIME: Complete this section within 15 minutes ------------------------------------------------------------------- THIS VRML SCENE IS USED IN ONE OF YOUR FINAL EXERCISES. COMPLETE IT NOW, OR AFTER CLASS: 1) Copy the source code from this first VRML97 Specification example ("D.2 Simple example"). The code is in bold (I've pasted it to the end of this message as well). 2) Run NotePad (usually located under START>PROGRAMS>ACCESSORIES) 3) Paste the code into a new text document 4) Save the file as "Simple.wrl" 5) BE SURE YOUR FILE HAS THE .wrl FILE EXTENSION 6) Open "Simple.wrl" in your Web browser. What do you see? NOTE that NotePad will automatically add a ".txt" extension to your Simple.wrl file, so that the file you create will be incorrectly named: Simple.wrl.txt In this case you need to right-click on the file, choose RENAME from the popup menu, and remove the ".txt" so that its new name is: Simple.wrl The NotePad tool puts the .txt extension on automatically, so you have to remove it manually. --- below is the source code to copy/paste ----> #VRML V2.0 utf8 Transform { children [ NavigationInfo { headlight FALSE } # We'll add our own light DirectionalLight { # First child direction 0 0 -1 # Light illuminating the scene } Transform { # Second child - a red sphere translation 3 0 1 children [ Shape { geometry Sphere { radius 2.3 } appearance Appearance { material Material { diffuseColor 1 0 0 } # Red } } ] } Transform { # Third child - a blue box translation -2.4 .2 1 rotation 0 1 1 .9 children [ Shape { geometry Box {} appearance Appearance { material Material { diffuseColor 0 0 1 } # Blue } } ] } ] # end of children for world }