Perhaps look at achieving this stuff using matrix multiplications in a more generalized 3d pipeline kind of approach.

I sent you a PM with my details if you want my help!