Constructing a 3D scatter plot