Hi,
This is how to make a sine wave in Blender:
- Create a new project (CTRL-x)
- Go to the Text editor window (SHFT-F11)
- Create some new text (RMB >> New)
- Type in the following (be careful to use the correct indenting!):import math
import Blender
from Blender import NMesh
x = -1 * math.pi
mesh = NMesh.GetRaw()
vNew = NMesh.Vert( x, math.sin( x ), 0 )
mesh.verts.append( vNew )
while x < math.pi:[INDENT] x += 0.1
vOld = vNew
vNew = NMesh.Vert( x, math.sin( x ), 0 )
mesh.verts.append( vNew )
mesh.addEdge( vOld, vNew )
NMesh.PutRaw( mesh, “SineWave”, 1 )
Blender.Redraw()
[/INDENT]Now do this:
- Run the script using ALT-p.
- Change the Window type to 3D View (its corresponding # icon is in the drop-down menu)You should see a sine wave.
But more importantly, this also serves as a basic introduction to how to perform a little Python scripting inside of Blender. More information at:
http://www.zoo-logique.org/3D.Blender/scripts_python/API/trees.html
http://www.python.org
http://jmsoler.free.fr/didacticiel/blender/tutor/python_script00_en.htm
T