working version taken form Julia3D demos