added matrix3d support