Created
February 3, 2012 12:05
-
-
Save bobye/1729860 to your computer and use it in GitHub Desktop.
batch snapshot of 3D objects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "## Temp command for Geomview" > tmp.gcl | |
for filename in $*; do | |
filebase=$(basename $filename) | |
outputbase=$(basename $filebase .off) | |
echo "" >> tmp.gcl | |
echo "(load $filename geometry)" >> tmp.gcl | |
echo "(backcolor Camera 1. 1. 1.)" >> tmp.gcl | |
echo "(zoom Camera 1.3)" >> tmp.gcl | |
echo "(merge-ap $filebase appearance {" >> tmp.gcl | |
echo " shading smooth" >> tmp.gcl | |
echo " +transparent" >>tmp.gcl | |
echo " material {" >> tmp.gcl | |
echo " diffuse 1. 1. .5" >> tmp.gcl | |
echo " alpha 0.5" >> tmp.gcl | |
echo " }" >> tmp.gcl | |
echo " })" >> tmp.gcl | |
echo "(bbox-draw $filebase no)" >>tmp.gcl | |
echo "(sleep-for 1)" >> tmp.gcl | |
echo "(snapshot Camera $outputbase.ppm)" >>tmp.gcl | |
echo "(delete $filebase)" >> tmp.gcl | |
echo "(camera-reset Camera)" >> tmp.gcl | |
done | |
echo "(quit)" >> tmp.gcl | |
# geomview -c tmp.gcl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment