add matrix3d from Greg Caldwell