Added x3d writing