#!/bin/bash
dir=${pwd}
name=$1
subdir=$2
if [[ $2 = "" ]] ; then
	$2="."
fi

echo "renaming files in ./${2}/ to ${1}_XX.jpg"
cd $2
cp 0001.jpg "${1}_BK.jpg"
cp 0002.jpg "${1}_LF.jpg"
cp 0003.jpg "${1}_FR.jpg"
cp 0004.jpg "${1}_RT.jpg"
cp 0005.jpg "${1}_UP.jpg"
cp 0006.jpg "${1}_DN.jpg"
cd $dir

echo -e "creating material script:\n"
echo -e "material Orxonox/${1}{\n\ttechnique{\n\t\tpass{\n\t\t\tlighting off\n\t\t\tdepth_write off\n\t\t\ttexture_unit{\n\t\t\t\tcubic_texture ${1}.jpg separateUV\n\t\t\t\ttex_address_mode clamp\n\t\t\t}\n\t\t}\n\t}\n}"
