code for frustum creation