3D IFS fractals in Maya!

So after 4 weeks of Python classes (having not used the language before then, aside from a class around 6 years before where I did nothing but simple text based stuff) I have managed to create a 3D fractal creator in Maya. Total time taken was about 12 hours (it was working in around 7, the rest of the hours were spent on optimization). It runs quite fast, right now the most time consuming operation is creating and moving the cubes (or spheres, which I recently changed it to using because it looks better and isn't much slower). I hope to mitigate that by switching to a particle system instead of just using a ton of primitives.

Basically the process is, using the 4x4 matrix class I created, get a transformation matrix from the scale, rotation and translations of "motif cubes" (certain cubes in the scene, in a group) and repeatedly multiply an identity matrix by each of them in a recursive function until the scale gets too small or the iterations reaches zero. Then just get the translation of the resulting matrix, make it into a point (represented as a 3D vector) and add it to a list. When we're done, move all of the generated cubes (or spheres) to the specified points (instead of creating them every time, which would be much more expensive). You can reposition the motif cubes and re-generate the fractal to see how it changes. The generation only takes a couple seconds (which is the time it takes Maya to process all of the move commands). Improvements I'm planning on making include adding a UI, and switching to particles instead of primitives to save on processing time.

Featured Posts
Recent Posts
Search By Tags
Follow Us
  • Facebook Basic Square
  • Twitter Basic Square
  • Google+ Basic Square