cleanup of old math functions, fixed index generation in cubeManager, still cant get the projection matrix right.