The simplest thing is to use glu functions. I work mainly in C, but in Java it is probably something like:
import net.java.games.jogl.GL; import net.java.games.jogl.GLU; import net.java.games.jogl.GLUquadric; ... GLUquadric quad = glu.gluNewQuadric(); glu.gluSphere(quad, 2, 10, 15); glu.gluDeleteQuadric(quad);
This will create a sphere of radius 2 with 10 longitude divisions and 15 latitudinal divisions. It will also handle the creation of texture coordinates and regular normals.
If you really want to understand how to make subdivisions and create a spherical approximation yourself, you can see this code .
source share