How to color a sphere non-uniformly ?

I am drawing a sphere using ‘gluSphere()’, after setting the color with ‘glColor3f()’. I would like to apply different colors to the two sides of the sphere e.g. to specify the colors separately for each segment of the sphere. Is there a way to do that, that is documented online ?
Thanks for any pointers…

either with texture or rendering the sphere with multiple draw calls one part at a time, changing the color. gluSphere renderes whole sphere i guess but you could use clipping planes to cut through. better yet textures.

Just write your own sphere drawing code and you will have control of texture coordinates or the color of each vertex. Otherwise you won’t.

As NK47 suggests, you could use gluSphere to draw two spheres with different colors or textures, then use glClipPlane to cut away half of each sphere. This approach would be the easier of the two - BUT is limited to fairly simple sphere tesselations. This is how I did the earth in the figure below …

Two Spheres Cut In Half Using glClipPlane

If you want to get fancy and apply lots of different colors/textures to various pieces of the sphere, you have to write your own sphere routine, as dletozeun says. This is how I did the polygonal earth below. It’s not that hard to write your own sphere routine. It would be an interesting OpenGL exercise for a beginner.

Polygonal Sphere