Implemented the set2DMode and set3DMode methods