m.nviz.script.html 4.9 KB

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