#!/bin/sh

rm -f mug.pix
rt -M -C 100/100/100 -o mug.pix cup.g mug.r <<EOF
viewsize 1.524000000000000e+02;
eye_pt 5.657117538976507e+01 6.665466085391886e+01 7.728851062911396e+01;
orientation 2.480973490458727e-01 4.765905732660483e-01 7.480973490458729e-01 3.894348305183902e-01;
start 0; clean;
end;

EOF


exit
rm -f mug.pix cup.pix handle.pix cup_sub.pix handle_sub.pix

rt -M -C 100/100/100 -o mug.pix cup.g mug.r <<EOF
viewsize 1.524000000000000e+02;
eye_pt 5.657117538976507e+01 6.665466085391886e+01 7.728851062911396e+01;
orientation 2.480973490458727e-01 4.765905732660483e-01 7.480973490458729e-01 3.894348305183902e-01;
start 0; clean;
end;

EOF


rt -M -C 100/100/100 -o cup_sub.pix cup.g cup_out.r cup_in.r <<EOF
viewsize 1.524000000000000e+02;
eye_pt 5.657117538976507e+01 6.665466085391886e+01 7.728851062911396e+01;
orientation 2.480973490458727e-01 4.765905732660483e-01 7.480973490458729e-01 3.894348305183902e-01;
start 0; clean;
end;

EOF

rt -M -C 100/100/100 -o cup.pix cup.g cup.r <<EOF
viewsize 1.524000000000000e+02;
eye_pt 5.657117538976507e+01 6.665466085391886e+01 7.728851062911396e+01;
orientation 2.480973490458727e-01 4.765905732660483e-01 7.480973490458729e-01 3.894348305183902e-01;
start 0; clean;
end;

EOF

rt -M -C 100/100/100 -o handle.pix cup.g handle.r <<EOF
viewsize 1.524000000000000e+02;
eye_pt 5.657117538976507e+01 6.665466085391886e+01 7.728851062911396e+01;
orientation 2.480973490458727e-01 4.765905732660483e-01 7.480973490458729e-01 3.894348305183902e-01;
start 0; clean;
end;

EOF

rt -M -C 100/100/100 -o handle_sub.pix cup.g eto.r eto_sub.r <<EOF
viewsize 1.524000000000000e+02;
eye_pt 5.657117538976507e+01 6.665466085391886e+01 7.728851062911396e+01;
orientation 2.480973490458727e-01 4.765905732660483e-01 7.480973490458729e-01 3.894348305183902e-01;
start 0; clean;
end;

EOF

fbclear 100 100 100
pixhalve cup_sub.pix | pix-fb -s 256 -X 0 -Y 0
pixhalve cup.pix | pix-fb -s 256 -X 256
pixhalve handle_sub.pix | pix-fb -s 256 -Y 256
pixhalve handle.pix | pix-fb -s 256 -Y 256 -X 256
pixhalve mug.pix | pix-fb -s 256 -X 640 -Y 128

fb-pix -w 1280 -n 512 cup-w1280-n1024.pix
pix-ppm -w 1280 -n 512 cup-w1280-n1024.pix > cup.ppm
