sample code for 3D drawing