working resize. working switch between 2d and 3d.