There is an fantastic answer by DMGregory here where he explains how to calculate and generate the vertices of an UV Sphere: OpenGL calculate UV sphere vertices
Based on his code, how can we change the "altitude" of each individual vertex?
To create something like this:
radius
parameter. That determines the "altitude" from the center of the sphere. Vary that, and you get mountains and valleys. Can you show us how you've tried to vary the radius in your code so far? \$\endgroup\$