You can also take a look at sphere/cylinder/cone/cube -> mesh convertion in my engine. The code doesn't do direct rendering (it only converts to a mesh in TNodeIndexedFaceSet instance), and it's a little involved (I have to deal with texture coords, optional over-triangulating for Gouraud shading and such), but maybe it will be useful for some hints anyway. It's LGPL.

https://vrmlengine.svn.sourceforge.n...e_cylinder.inc
https://vrmlengine.svn.sourceforge.n...lnodes_box.inc
https://vrmlengine.svn.sourceforge.n...des_sphere.inc