#!/bin/bash
#
# Demonstrate stereo3d script by making stereo pair of
# view down pore of LT B-pentamer
#
if [ "$TMPDIR" ]; then
       tmp=$TMPDIR
else
       tmp=/tmp
fi
export TMPDIR=$tmp
#
# First we make a VDW model of the B-pentamer itself
#
grep ' [DEFGH] ' LT.pdb > $TMPDIR/$$_temp.r3d
cat chaincolours.pdb $TMPDIR/$$_temp.r3d | balls -h > $TMPDIR/$$_balls.r3d
#
# Now we make a simple ribbon for the A2 domain
#
grep ' C ' LT.pdb | ribbon -h -d1 > $TMPDIR/$$_ribbon.r3d
#
# put 'em together with a view matrix
#
cat header8.r3d $TMPDIR/$$_balls.r3d $TMPDIR/$$_ribbon.r3d > $TMPDIR/$$_example8.r3d
#
# Now render it as a stereo pair
# Add a gamma correction before displaying
#
stereo3d -png < $TMPDIR/$$_example8.r3d | display -gamma 1.2 png:-
#
#
# Clean up
#
rm -f $TMPDIR/$$_temp.r3d $TMPDIR/$$_balls.r3d $TMPDIR/$$_ribbon.r3d $TMPDIR/$$_example8.r3d
