moved boilerplate code into ThreeApp class
removed global var mesh from main