Нечто отдаленно напоминающее л-сустем
Алгоритмическая ботаника рвет мне мозг
SeedRnd MilliSecs()
Global ph
Global gh
gh=xCreateCylinder(8)
xPositionMesh gh,0,1,0
xScaleMesh gh,0.1,1,0.1
ph=xCreateCube()
xPositionMesh ph,0,1,0
CreateChilds(ph)
For d=0 To xCountChildren(ph)-1
child=xGetChild(ph,d)
CreateChilds(child)
Next
For d=0 To xCountChildren(ph)-1
child=xGetChild(ph,d)
For z=0 To xCountChildren(child)-1
childl2=xGetChild(child,z)
CreateChilds(childl2)
Next
Next
For d=0 To xCountChildren(ph)-1
child=xGetChild(ph,d)
For z=0 To xCountChildren(child)-1
childl2=xGetChild(child,z)
For x=0 To xCountChildren(childl2)-1
childl3=xGetChild(childl2,x)
CreateChilds(childl3)
Next
Next
Next
Function CreateChilds(child)
qbranches=Rand(1,3)
For i=0 To qbranches
pc=xCopyEntity(gh,child)
xPositionEntity pc,0,2,0
xRotateEntity pc,40+Rnd(-15,15),i*(360/(qbranches+1))+Rnd(-25,25),0
Next
End Function