[GRASS-dev] nviz scripting

Helena Mitasova hmitaso at unity.ncsu.edu
Tue Aug 29 14:25:09 EDT 2006


Do I recall correctly that there were changes made to nviz open and play 
script?

I am trying to prepare a section for GRASS visualization workshop
on creating dynamic surfaces using file sequencing tool and when I try 
to play
the script created by the file sequencing tool I get segmentation fault.
I used it just few months ago for animation like this:
http://terrain.cs.duke.edu/topo_change/graphics/GRSLmitasanim.gif

I have attached the script (it does just the left side surface in the 
animation above),
it is very simple,
- I am wondering whether whoever knows about the change would have
a suggestion how to fix it - and whether there is a problem at all with 
this script.
I have a new 64bit machine so it maybe related to that rather than the 
scripting tool.
I would also like to add this to the 3rd edition of grassbook, as it is 
a really
effective way how to visualize e.g. dynamics of water flow or solar 
radiation
and it is pretty easy to do.

thanks a lot

Helena



-- 
Helena Mitasova
Department of Marine, Earth and Atmospheric Sciences
North Carolina State University
1125 Jordan Hall
NCSU Box 8208
Raleigh, NC 27695-8208
http://skagit.meas.ncsu.edu/~helena/

email: hmitaso at unity.ncsu.edu
ph: 919-513-1327 (no voicemail)
fax 919 515-7802

-------------- next part --------------
# This script created by the script_file_tools program
global Nv_mapLoopMode Nv_mapLoopFile
set Nv_mapLoopMode 0
set Nv_mapLoopFile ""
SendScriptLine "Nunset_cancel_func"

proc pad { x } {
 while {[string length "$x"] < 5} {
  set x "0$x"
 }
 return $x
}


# Start of file sequence code
set mhandle4 [ReturnMapHandle surf*1156873956]
set mhandle5 [ReturnMapHandle surf*1156873956]
for {set iloop3 0} {$iloop3 < 12} {incr iloop3} {
 SendScriptLine "global NVIZ_BLANK_MAPS"
 SendScriptLine "set NVIZ_BLANK_MAPS {}"
 if {$iloop3 < 12} then {
  if {[lsearch {} $iloop3] == -1} then {
   if {[lsearch {} $iloop3] > -1}  then {
    SendScriptLine "lappend NVIZ_BLANK_MAPS [ExtractMapID $mhandle4]"
   } else {
    SendScriptLine "$mhandle4 set_att topo [lindex {lid99.t065s01 at ieee lid99.t080s01 at ieee lid99.t100s01 at ieee lid99.t125s01 at ieee lid99.t150s01 at ieee lid99.t200s01 at ieee lid99.t250s01 at ieee lid99.t300s01 at ieee lid99.t400s01 at ieee lid99.t500s01 at ieee lid99.t700s01 at ieee lid99.t900s01 at ieee} $iloop3]"
   }
  }
 }
 if {$iloop3 < 12} then {
  if {[lsearch {} $iloop3] == -1} then {
   if {[lsearch {} $iloop3] > -1}  then {
    SendScriptLine "lappend NVIZ_BLANK_MAPS [ExtractMapID $mhandle5]"
   } else {
    SendScriptLine "$mhandle5 set_att color [lindex {pc99.t065s01 at ieee pc99.t080s01 at ieee pc99.t100s01 at ieee pc99.t125s01 at ieee pc99.t150s01 at ieee pc99.t200s01 at ieee pc99.t250s01 at ieee pc99.t300s01 at ieee pc99.t400s01 at ieee pc99.t500s01 at ieee pc99.t700s01 at ieee pc99.t900s01 at ieee} $iloop3]"
   }
  }
 }
 # Image saving code here
 if {[catch {set Frame_Num}]} then { set Frame_Num 0 }
 SendScriptLine "Nsurf_draw_all"
 SendScriptLine "Nvect_draw_all"
 SendScriptLine "Nsite_draw_all"
 SendScriptLine "Nwrite_rgb jrpc[pad $Frame_Num].rgb"
 incr Frame_Num
 after 1000
}



More information about the grass-dev mailing list