Made it work in 3D, still not quite right though. Currently have a hack to fix the incorrect data