moved openGL code from ThreeDimensionObject constructors to a dedicated method