Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

176 lines
5.2 KiB

  1. <HTML>
  2. <HEAD>
  3. <BODY LEFTMARGIN=0 TOPMARGIN=0 BGCOLOR="#FFFFFF">
  4. <FONT FACE="ARIAL" COLOR="BLACK">
  5. <IMG SRC="hcreate.GIF" ALT="Internet Development Technologies">
  6. <BLOCKQUOTE>
  7. <TITLE>Creating ActiveVRML animations </TITLE>
  8. </HEAD>
  9. <BODY>
  10. <CENTER>
  11. <H3>Creating ActiveVRML animations <P></H3>
  12. </CENTER>
  13. <P>
  14. This page describes how you can quickly write and
  15. run your own ActiveVRML scripts. We recommend you get started by looking at the examples we provide.
  16. <P>
  17. The primary tool we currently use for directly writing ActiveVRML
  18. content is a program called the &quot;repl&quot;, standing for
  19. &quot;Read-Evaluate-Print-Loop&quot;, similar to the REPL's in
  20. other interpreted languages. The repl allows ActiveVRML expressions
  21. to be evaluated, and allows an environment to be built up.
  22. <P>
  23. As such, it's very useful for exploratory, incremental programming
  24. - determining the types of expressions, using partial results
  25. in subsequent expressions, etc.
  26. <P>
  27. The user may type declarations such as
  28. <P>
  29. myGeo = geo1 union geo2;;
  30. <P>
  31. directly. Note that two semicolons are required after each piece
  32. of input to the repl.
  33. <P>
  34. Also, the repl supports a number of useful &quot;directives&quot;
  35. preceded with #:
  36. <UL>
  37. <LI>#setdir &lt;pathname&gt;;; -- set the current working directory. Example: #setdir "c:\mydir";;
  38. <LI>#use &lt;filename&gt;;; -- load a file into the environment being built up in the repl. Identifiers in the filename will
  39. then be available. Example: #use "foo.avr"
  40. <LI>#add &lt;str&gt;,&lt;id&gt;;; -- add the id to the list of
  41. behaviors being sampled and displayed. Example: #add "cool", model;;
  42. <LI>#eval &lt;expression&gt;;; -- directly evaluate an ActiveVRML expression. Example: #eval 1 + 2;;
  43. <LI>#delete &lt;str&gt;;; -- remove the id from the list. Example: #delete "cool"
  44. <LI>Ctrl-C -- to exit the repl.
  45. </UL>
  46. <P>
  47. <H2>Using the Repl</H2>
  48. <P>
  49. <B>Down loading sample AVR files:</B>
  50. <P>
  51. Copy to your local drive the entire \Samples directory from
  52. \\ACTGFX\ACTIVE
  53. <P>
  54. Place your local samples directory anywhere you want.
  55. <P>
  56. This directory will copy several AVR files (*.avr) and some resources
  57. needed. AVR files contain the actual code that gets interpreted
  58. by the engine via the Repl.
  59. <P>
  60. Loading an AVR file into the Repl can be done from a DOS box by typing : repl &lt;filename.avr&gt; The repl is located in "\Program Files\Plus!\Microsoft Internet\A-vrml". <P>
  61. The Repl window looks like a DOS command window with a &gt; prompt. At the
  62. beginning of every session you'll get a typical &quot;Welcome
  63. to ActiveVRML &quot; message on your window.
  64. <P>
  65. ActiveVRML is an interpreted language so there is no need to compile
  66. your scripts. You can also directly type AVR code at the prompt
  67. and work with the repl interactively.
  68. <P>
  69. Load the model by typing:
  70. #add &quot;cool&quot;, model;;
  71. <P>
  72. IMPORTANT: Always type 2 semicolons after every # command
  73. <P>
  74. This command tells the repl to sample the variable 'model' and
  75. assigns a tag called &quot;cool&quot;.
  76. <P>
  77. The general syntax for #add is:
  78. <P>
  79. #add &lt;any quoted string&gt;,&lt; identifier&gt;;;
  80. <P>
  81. where the identifier is a variable defined in the avr file
  82. <P>
  83. <B>To Terminate sampling:</B>
  84. <OL>
  85. <LI>At the &gt; prompt type:
  86. </OL>
  87. <P>
  88. #delete &lt;quoted string&gt;;;
  89. <P>
  90. Make sure the string matches the one you used for the #add
  91. <P>
  92. <B>To exit the Repl:</B>
  93. <P>
  94. At the &gt; prompt hit Ctrl+C
  95. <H2>Sample Repl session</H2>
  96. <P>
  97. The following is a sample repl session that displays a somewhat
  98. interesting image animation. The user types the bold lines.
  99. The others are response lines.
  100. <P>
  101. <TT>Welcome to ActiveVRML version 1.0.</TT>
  102. <P>
  103. <TT><B>&gt; redIm = solidColorImage(red);;</B></TT>
  104. <P>
  105. <TT>redIm : () (image)</TT>
  106. <P>
  107. <TT><B>&gt; w = 0.004 + 0.004 * abs(sin(time));;</B></TT>
  108. <P>
  109. <TT>w : () (number)</TT>
  110. <P>
  111. <TT><B>&gt; w2 = w * 2;;</B></TT>
  112. <P>
  113. <TT>w2 : () (number)</TT>
  114. <P>
  115. <TT><B>&gt; blueIm = crop(point2Xy(-w,-w),</B></TT>
  116. <P>
  117. <TT><B> point2Xy(w,w),</B></TT>
  118. <P>
  119. <TT><B> solidColorImage(blue));;</B></TT>
  120. <P>
  121. <TT>blueIm : () (image)</TT>
  122. <P>
  123. <TT><B>&gt; model = tile(point2Xy(-w2,-w2),</B></TT>
  124. <P>
  125. <TT><B> point2Xy(w2,w2),</B></TT>
  126. <P>
  127. <TT><B> blueIm)</B></TT>
  128. <P>
  129. <TT><B> over redIm;;</B></TT>
  130. <P>
  131. <TT>model : () (image)</TT>
  132. <P>
  133. <TT><B>&gt; #add &quot;mine&quot;, model;;</B></TT>
  134. <P>
  135. (At this point, a window comes up and starts displaying the image
  136. behavior)
  137. <P>
  138. Note here that after every expression evaluation, the system prints
  139. out the type of the expression. Also, #add only supports certain
  140. types. Currently, #add supports only image, image*sound, and
  141. image*sound*sound types. To view a geometry, you must use &quot;renderedImage&quot;
  142. to render it into an image, and then #add the image.
  143. <H2>Documentation</H2>
  144. <P>
  145. We have a
  146. <A HREF=earth.htm> tutorial </A> and a
  147. <A HREF=avrml.htm> full spec reference </A>
  148. in our Website that you can consult for more details on how to write content.
  149. <H2>Reporting Problems and Support</H2>
  150. <P>
  151. Please send all your bug reports to EnriqueP or ToddFe. Please
  152. include your system configuration along with detailed steps to
  153. reproduce the problem.
  154. <H2>Feature Requests and Suggestions</H2>
  155. <P>
  156. We welcome any feedback that you may have. Please send email to
  157. ColinC and cc. EnriqueP.
  158. </BLOCKQUOTE>
  159. </BODY>
  160. </HTML>