m.nviz.script.html 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <h2>DESCRIPTION</h2>
  2. The <em>m.nviz.script</em> program allows the user to easily create a script
  3. that can be run in NVIZ to fly through a terrain.
  4. The NVIZ flight path can be chosen interactively from the GRASS
  5. monitor (<em>-i</em>) or supplied on the command line as comma
  6. separated coordinates. The program optionally allows a KeyFrame
  7. file to created (after running the script). This KeyFrame file can
  8. be loaded into the <em>Keyframe Animation</em> panel for fine
  9. tuning or editing.
  10. <p>The script generated by <em>m.nviz.script</em> can be run from the NVIZ
  11. command line (nviz script=script_name) or after NVIZ is started by
  12. selecting <em>Scripting->Play Script</em>.
  13. <h2>OPTIONS</h2>
  14. <h3>Flags:</h3>
  15. <dl>
  16. <dt><b>-i</b>
  17. <dd>Intercative mode
  18. <dd>The user selects the camera path from the GRASS monitor by
  19. clicking the left mouse button along the route. Click the
  20. right mouse button to finish.
  21. <dt><b>-f</b>
  22. <dd>Full render
  23. <dd>The script will draw all loaded NVIZ data and save scene to PPM image.
  24. <dt><b>-c</b>
  25. <dd>Flay at constant elevation
  26. <dd>With this flag the camera will be set to an elevation given by the
  27. <em>ht=</em> parameter. The default is to fly at <em>ht=</em>
  28. above the topography (i.e. camera height = elevation + ht)
  29. <dt><b>-k</b>
  30. <dd>Output KeyFrame file
  31. <dd>Generate a KeyFrame file that can be loaded from the NVIZ
  32. <em>Keyframe Animation</em> panel. The KeyFrame file is
  33. automatically assigned the script name with a
  34. <em>.kanimator</em> extension.
  35. <dt><b>-o</b>
  36. <dd>Render the animation in an off-screen context
  37. <dt><b>-e</b>
  38. <dd>Enable vector and sites drawing
  39. </dl>
  40. <h3>Parameters:</h3>
  41. <dl>
  42. <dt><b>input</b>
  43. <dd>The name of the GRASS raster map with elevation data.
  44. <dd>This should be the same file that will be loaded in NVIZ.
  45. <dt><b>output</b>
  46. <dd>The name of the NVIZ script to create.
  47. <dt><b>name</b>
  48. <dd>The prefix for output images if running in full render mode (<em>-f</em>).
  49. <dd>The defulat preifix is NVIZ (eg. NVIZ0000.ppm).
  50. <dt><b>dist</b>
  51. <dd>The distance of the camera behind the center of view.
  52. <dt><b>ht</b>
  53. <dd>The height of the camera above the center of view.
  54. <dd>If the the <em>-c</em> flag is set, the height represents the actual camera height.
  55. <dt><b>frames</b>
  56. <dd>The number of frames in the animation.
  57. <dt><b>start</b>
  58. <dd>The starting frame number (default = 0).
  59. <dd> This option may be useful in full render mode when creating an
  60. animation in sections. For example the user may wish to start at frame
  61. number 2000.
  62. <dt><b>route</b>
  63. <dd>The comma separated geographic coordinates for keyframe locations.
  64. <dd>The interactive flag (<em>-i</em>) overrides this option.
  65. </dl>
  66. <h2>EXAMPLE</h2>
  67. To interactively create an NVIZ animation from raster elev.rast with
  68. 500 frames and the camera set to 50 meters above and 250 meters behind
  69. the scene, run the following:
  70. <div class="code"><pre>
  71. g.region raster=elevation.dem
  72. d.rast elevation.dem
  73. m.nviz.script -ik input=elevation.dem output=nviz.script dist=2400 ht=1220 frames=1000
  74. </pre></div>
  75. In the above the example the user is prompted to select the route from the GRASS monitor.
  76. The output script, 'nviz.script.nvscr', can then be run in NVIZ:
  77. <div class="code"><pre>
  78. nviz elevation=elevation.dem script=nviz.script.nvscr
  79. </pre></div>
  80. <h2>NOTES / HINTS</h2>
  81. The user must select at least four key-frame locations (points)
  82. otherwise an error is generated.
  83. <p>If the GRASS region is changed the <em>m.nviz.script</em> command must be re-run.
  84. <p>The current GRASS region and the user supplied parameters are included
  85. as a comment at the top of the output script. This information can be
  86. used to easily re-create the animation.
  87. <p>The camera position is calculated backwards from the supplied
  88. position(s). It is possible that the camera position will lie outside
  89. the current window, in which case a non-fatal error is generated
  90. (Error: selected point is outside region). This error can result in
  91. jerky movements during the animation. To correct this problem reduce
  92. the <em>dist=</em> parameter or increase the current region.
  93. <h3>Loading the script into NVIZ</h3>
  94. The user can run the script at arbitrary resolution. To re-run it at
  95. higher spatial resolution or different settings, the user first loads
  96. the surface and sets the resolution, lighting, etc. Then internally
  97. the script generated by <em>m.nviz.script</em> is run. Alternatively, the
  98. user can run nviz with a previuosly saved state and the
  99. <em>m.nviz.script</em> generated script:
  100. <div class="code"><pre>
  101. nviz state=saved.state script=nviz.script.nvscr
  102. </pre></div>
  103. <h3>Keyframe animator script</h3>
  104. Running the script generated by <em>m.nviz.script</em> within NVIZ, a new script for
  105. kanimator (keyframe animator) is created. The kanimator panel offers
  106. fine tuning of the speed (frame rate) as well as editing individual
  107. frames or inserting new frames. This new kanimator script has to be
  108. loaded from the Kanimator panel in NVIZ. In the Kanimator panel there
  109. are Save and Load button which allow the user to save and re-load a
  110. kanimator script. Once loaded, the key frames will appear in the GUI
  111. and can then be edited there.
  112. <h2>SEE ALSO</h2>
  113. <em><a href="wxGUI.nviz.html">wxGUI 3D viewer (NVIZ)</a></em>
  114. <h2>AUTHOR</h2>
  115. <a href="mailto:bcovill@tekmap.ns.ca">Bob Covill</a>
  116. <p><i>Last changed: $Date$</i>