XaiJu
John Kunz
John Kunz

patreon


Plant Phyllotaxis with VEX

In the spirit of the beginning Spring (for us on the Northern Hemisphere at least), I thought I'd share a simple and straightforward way to generate these plant seed arrangements.


I find this really handy to have on hand for tons of procedural modeling and effects setups so I've tried to simplify the code to be as bare bones as possible while still providing the ability to set point orientation as well as 3D depth so there's a bit of curvature if needed.  Hopefully this proves to be a useful starting point or building block in your setups as well.


You can check out this article for lot's of really cool inspiration for possible applications of this as well as lot's of diagrams which explain a bit of the math.

https://www.cosmic-core.org/free/article-178-botany-the-geometry-of-plants-part-1-fibonacci-sequence/


I know that this is already a common technique but for whatever reason I've always had issues when I've gone to grab it from other snippets I've seen online before.  One issue I always had was the scale in other setups isn't normalized so as you increase the point count the entire arrangement keeps expanding so in this case I've normalized it to a unit.  Another issue I've had was overly complex code which can be a pain to modify if your in a hurry ;)


If your just after the point wrangle code and don't want to bother with the file, the code is here.


float r = 1.0/pow(@numpt-1, 0.5);   // Radius distance scaled by total seeds
float phi = chf('angle');           // Degrees to twist consecutive seeds

@P.x = r * sqrt(@ptnum) * cos(radians(phi)*@ptnum);
@P.y = r * sqrt(@ptnum) * sin(radians(phi)*@ptnum);

@P.z = @ptnum * 0.025 * r;          // Extrude along Z axis (Optional)
p@orient = quaternion(radians(phi*@ptnum), set(0,0,1));  // Seed orientation (Optional)


Thank you to all the new supporters who've found your way here recently!  I'm very gracious of all the new followers and to everyone else whose shared my Patreon recently, especially Matt Estela (https://twitter.com/thecgwiki) :)

Plant Phyllotaxis with VEX Plant Phyllotaxis with VEX Plant Phyllotaxis with VEX

More Creators