Community/Tasks/osgNature: generate_xml_to_textures.sh.txt.sh
| Line | |
|---|---|
| 1 | #!/bin/sh |
| 2 | #render a arbaro generated pov file into textures |
| 3 | #author: Fred Marmond <fmarmond@users.sourceforge.net> |
| 4 | #2005-01-09 |
| 5 | #It uses ARBARO (http://arbaro.sourceforge.net/), a wonderfull tree generetor in GPL. |
| 6 | #My final goal: automagically generate tree mesh for OSG with LOD |
| 7 | # |
| 8 | #this script uses ARBARO and a curstom script (render_pov_to_textures.sh) to generate an xml tree definition into textures (see render_pov_to_textures.sh for more details) |
| 9 | |
| 10 | #params: $1 xml file name |
| 11 | # (optional) $2 arbaro options ($2 may be = "-m 0.9 -s 5 -l 3" for example |
| 12 | #output: see render_pov_to_textures.sh |
| 13 | |
| 14 | #todo: - try to determine the output image ratio to avoid cuted images (and optimize texture usage) |
| 15 | # - actually, only texture are rendered, i'll have to add other systems to generate 3d mesh LOD as well |
| 16 | |
| 17 | #requirements: |
| 18 | #- (see render_pov_to_textures.sh) |
| 19 | #- java 1.4 (see arbaro package for more infos, as java is only needed by arbaro) |
| 20 | #- this script must be copied and runned from the directory contening arbaro |
| 21 | |
| 22 | #info: to generate from many xml files in one batch, just do: |
| 23 | # for file in trees/*.xml; do ./generate_xml_to_textures.sh $file ; done |
| 24 | |
| 25 | |
| 26 | |
| 27 | xmlname="$1" |
| 28 | basename=`echo "$xmlname" | sed 's/\.*\/\(.*\)\.xml$/\1/'` |
| 29 | |
| 30 | smooth="$2" |
| 31 | |
| 32 | povname=/tmp/$basename.$$.pov |
| 33 | incname=/tmp/$basename.$$.inc |
| 34 | |
| 35 | java -Xms100m -Xmx200m -jar arbaro.jar $smooth -p $povname -o $incname $xmlname |
| 36 | ./render_pov_to_textures.sh $povname |
| 37 | |
| 38 | rm $povname |
| 39 | rm $incname |
