hey there…complete noob here, so bear with me.
ok, so this is what i have from one of the tutorials:
import Blender
from Blender import NMesh
import math
from math import *
me=NMesh.GetRaw()
i=0.0
j=0.0
maxpoint=32.0*32.0
n=sqrt(maxpoint)
print n
for i in range(0,n):
print i
for j in range(0,n):
print j
x=sin(j*pi*2/(n-1))*cos(-pi/2+i*pi/(n-1))*2
y=cos(j*pi*2/(n-1))*(1-cos(-pi/2+i*pi/(n-1)))*2
z=sin(-pi/2+i*pi/(n-1))*2
v=NMesh.Vert(x,y,z)
me.verts.append(v)
n0=len(range(0,n))
print n0
for i in range(0,n-1):
for j in range(0,n-1):
f=NMesh.Face()
f.v.append(me.verts[i*n0+j])
f.v.append(me.verts[i*n0+j+1])
f.v.append(me.verts[(i+1)*n0+j+1])
f.v.append(me.verts[(i+1)*n0+j])
me.faces.append(f)
NMesh.PutRaw(me,"plane",1)
Blender.Redraw()
now, i want to make it into a sphere, but what and where should i tweak it so that i can plug this in instead:
for i in range(0, n):
for j in range(0, n):
x = sin(j*pi*2/(n-1))*cos(-pi/2+i*pi/(n-1))*radius
y = cos(j*pi*2/(n-1))*cos(-pi/2+i*pi/(n-1))*radius
z = sin(-pi/2+i*pi/(n-1))*radius
v=NMesh.Vert( x , y , z )
me.verts.append(v)
do i also need to add anything else??
anyway, thanks for helping this noob!!