I can't run through this to what's going on in your code right now, but
hopefully these links will guide you to a swift solution.
http://www.f-lohmueller.de/pov_tut/tex/tex_560e.htm
http://news.povray.org/povray.binaries.images/thread/%3C5da9a3d7%241%40news.povray.org%3E/