home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / tt / raysh402 / guide.tex / node38_mn.html < prev    next >
Text File  |  1992-02-09  |  5KB  |  129 lines

  1.  
  2. <H1><A ID="SECTION001100000000000000000">
  3. Animation</A>
  4. </H1>
  5.  
  6. <P>
  7. <#988#><#2071#><EM>Rayshade</EM><#2071#><#988#> provides basic animation animation support by
  8. allowing time-varying
  9. transformations to be associated with primitives and aggregate objects.
  10. Commands are provided for controlling the amount of time between each
  11. frame, the speed of the camera shutter, and the total number of frames
  12. to be rendered.
  13.  
  14. <P>
  15. By default, <#989#><#2073#><EM>rayshade</EM><#2073#><#989#> renders a single frame, with the shutter open for
  16. an instant (0 units of time, in fact).  The shutter speed in no way
  17. changes the light-gathering properties of the camera, i.e., frames
  18. rendered using
  19. a longer exposure will not appear brighter than those with a shorter
  20. exposure.  The only change will be in the potential amount of movement
  21. that the
  22. frame ``sees'' during the time that the shutter is open.
  23.  
  24. <P>
  25. Each ray cast by <#990#><#2075#><EM>rayshade</EM><#2075#><#990#> samples a particular moment in time.
  26. The time value assigned to a ray
  27. ranges from the starting time of the current frame to the starting
  28. time plus the amount of time the shutter is open.  When
  29. a ray encounters an object or texture that possesses an animated
  30. transformation, the transformed
  31. entity is moved into whatever position is appropriate
  32. for the ray's current time value before intersection, shading, or texturing
  33. computations are performed.
  34.  
  35. <P>
  36. The starting time of the current frame is computed using the
  37. length of each frame
  38. the current frame number, and the starting time of the first frame.
  39.  
  40. <P>
  41. <DL>
  42. <DT><STRONG><#5121#><#5121#></STRONG></DT>
  43. <DD><#1677#><TT>shutter</TT><#1677#> <#1678#><EM>t</EM><#1678#> 
  44. <BR>    Specifies that the shutter is open for t units of
  45.     time for each exposure.
  46. </DD>
  47. </DL>A larger value of <#995#><EM>t</EM><#995#> will lead to more motion blur in the final
  48. image.   Note that <#996#><EM>t</EM><#996#> may be greater than the actual length
  49. of a frame.  By default, <#997#><EM>t</EM><#997#> is zero, which prevents all motion blur.
  50.  
  51. <P>
  52. <DL>
  53. <DT><STRONG><#5122#><#5122#></STRONG></DT>
  54. <DD><#1681#><TT>framelength</TT><#1681#> <#1682#><EM>frameinc</EM><#1682#> 
  55. <BR>    Specifies the time increment between frames.
  56. </DD>
  57. </DL>The default time between frames is 1 unit.
  58.  
  59. <P>
  60. <DL>
  61. <DT><STRONG><#5123#><#5123#></STRONG></DT>
  62. <DD><#1685#><TT>starttime</TT><#1685#> <#1686#><EM>time</EM><#1686#> 
  63. <BR>    Specifies the starting time of the first frame.
  64. </DD>
  65. </DL>By default, <#1006#><EM>time</EM><#1006#> is zero.
  66.  
  67. <P>
  68. Variables may be defined thorugh the use of the <#1007#><TT>define</TT><#1007#> keyword:
  69.  
  70. <P>
  71. <DL>
  72. <DT><STRONG><#5124#><#5124#></STRONG></DT>
  73. <DD><#1689#><TT>define</TT><#1689#> <#1690#><EM>name value</EM><#1690#> 
  74. <BR>    Associate <#1011#><EM>name</EM><#1011#> with the given <#1012#><EM>value</EM><#1012#>.  Value may
  75.     be a constant or a parenthesized expression.
  76. </DD>
  77. </DL>The variable <#1014#><EM>name</EM><#1014#> may thereafter be used in expressions in the
  78. input file.
  79.  
  80. <P>
  81. An animated transformation is one for which animated expressions have
  82. been used to define one or more of its parameters (e.g. the angle through
  83. which a rotation occurs).  An animated expression is one that makes
  84. use of a time-varying (``animated'') variable or function.
  85.  
  86. <P>
  87. There are two supported animated variables.
  88. The first, <#1015#><TT>time</TT><#1015#>, is equal to the current time.
  89. When a ray encounters an animated
  90. transformation defined using an expression containing <#1016#><TT>time</TT><#1016#>, the ray
  91. substitutes its time value into the expression before evaluation.
  92. Using the <#1017#><TT>time</TT><#1017#> variable in an animated expression is the most
  93. basic way to create blur-causing motion.
  94.  
  95. <P>
  96. The second animated variable, <#1018#><TT>frame</TT><#1018#>, is equal to the current
  97. frame number.  Unlike the <#1019#><TT>time</TT><#1019#> variable, <#1020#><TT>frame</TT><#1020#> takes on
  98. a single value for the duration of each frame.  Thus, transforms
  99. animated through the use of the <#1021#><TT>frame</TT><#1021#> variable will not exhibit
  100. motion blurring.
  101.  
  102. <P>
  103. Also supported is the <#1022#><TT>linear</TT><#1022#> function.  This function uses
  104. <#1023#><TT>time</TT><#1023#> implicitly to interplate between two values.
  105.  
  106. <P>
  107. <DL>
  108. <DT><STRONG><#5125#><#5125#></STRONG></DT>
  109. <DD><#1693#><TT>linear</TT><#1693#> <#1694#><TT>(</TT><#1694#> <#1695#><EM>Stime, Sval, Etime, Eval</EM><#1695#> <#1696#><TT>)</TT><#1696#> 
  110. <BR>    Linearly interpolate between <#1029#><EM>Sval</EM><#1029#> at time
  111.     <#1030#><EM>Stime</EM><#1030#> and <#1031#><EM>Eval</EM><#1031#> at time <#1032#><EM>Etime</EM><#1032#>.
  112.     If the current time is less than <#1033#><EM>Stime</EM><#1033#>, the function
  113.     returns <#1034#><EM>Sval</EM><#1034#>.  If the current time is greater than
  114.     <#1035#><EM>Etime</EM><#1035#>, <#1036#><EM>Eval</EM><#1036#> is returned.
  115. </DD>
  116. </DL>
  117. <P>
  118. The following example shows the use of the <#1038#><TT>time</TT><#1038#> variable to
  119. animate a sphere by translating it downwards over five frames.
  120. Note thet the <#1039#><TT>shutter</TT><#1039#> keyword is used to set the shutter duration
  121. in order to induce motion blurring.
  122.  
  123. <P>
  124. <PRE><tex2html_verbatim_mark>verbatim45#</PRE>
  125.  
  126. <P>
  127. Further examples of animation may be found in the Examples directory
  128. of the <#1042#><#2077#><EM>rayshade</EM><#2077#><#1042#> distribution.
  129.