Thursday, April 13, 2006

3D L-Systems at Last!

OK, it took me long enough, but I've finally modified nthd.org's turtle and L-system scripts to work in three dimensions. The turtle now rolls and pitches in addition to turning. This allows the script to render those three dimensional L-systems I've been dreaming about. I've uploaded a sample render of a 3D Hilbert curve to flickr:



I'll post the code here when I've finished cleaning it up. The above curve was generated with:

angle: 90°
axiom: X
rule: X→^<XF^<XFX-F^>>XFX&F+>>XFX-F>X->
iterations: 3

UPDATE: here's what a 4 iteration curve looks like when the camera orbits around it:

animated 3d hilbert curve

| | | | |

4 Comments:

At 11:53 PM, Anonymous Anonymous said...

Prepare to be assimilated by the Borg.

 
At 11:54 PM, Anonymous Anonymous said...

that was me...Matt...not the Borg...

 
At 8:45 AM, Blogger cyberchaos said...

Phew! You had me scared for a minute there...

I've been thinking it looks alot like the Borg cube too!

 
At 3:51 AM, Anonymous Anonymous said...

I am trying to write my own program to generate various types of 3D fractal images. Your help would be greatly appreciated. Please email me at dwarfstar@dwarfstar.com

Thanks,

DwarfStar

 

Post a Comment

<< Home