fork download
  1. <html>
  2. <head>
  3. <script language="JavaScript">
  4. <!-- hide
  5.  
  6. function vrmlScene() {
  7. vrml= open("", "displayWindow",
  8. "width=500,height=400,status=yes,toolbar=yes,menubar=yes");
  9.  
  10. // open document for further output
  11. vrml.document.open("x-world/x-vrml");
  12.  
  13. vr= vrml.document;
  14.  
  15. // create VRML-scene
  16. vr.writeln("#VRML V1.0 ascii");
  17.  
  18. // Light
  19. vr.write("Separator { DirectionalLight { ");
  20. vr.write("direction 3 -1 -2.5 } ");
  21.  
  22. // Camera
  23. vr.write("PerspectiveCamera { position -8.6 2.1 5.6 ");
  24. vr.write("orientation -0.1352 -0.9831 -0.1233 1.1417 ");
  25. vr.write("focalDistance 10.84 } ");
  26.  
  27. // Cube
  28. vr.write("Separator { Material { diffuseColor 0 0 1 } ");
  29. vr.write("Transform { translation -2.4 .2 1 rotation 0 0.5 1 .9 } ");
  30. vr.write("Cube {} } }");
  31.  
  32. // close the document - (not the window!)
  33. vrml.document.close();
  34. }
  35.  
  36. // -->
  37. </script>
  38. </head>
  39. <body>
  40.  
  41. <form>
  42. <input type=button value="VRML on-the-fly" onClick="vrmlScene()">
  43. </form>
  44.  
  45. </body>
  46. </html>
  47.  
Runtime error #stdin #stdout 0.01s 4980KB
stdin
Standard input is empty
stdout
Standard output is empty