Here’s a snippet of code where I use my routine:
sphere = makeGeodesicSphere(4, 500, [1,1,1,1], 'TestSphere')
testSphereNode = render.attachNewNode('TestSphereNode')
testSphereNode.attachNewNode(sphere)
testSphereNode.setPos(0,0,1005)
I will explain the makeGeodesicSphere call’s arguments:
4 = level of recursion.
500 = scale. This determines the radius of the sphere.
[1,1,1,1] = Color information. RGB + intensity
‘TestSphere’ = name of the Geom object you are getting back.
Also be sure that you are importing the math module, as the routines make use of trig functions.