DZone
Mobile Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Mobile Zone > Chaos in Houdini! Modeling Strange Attractors with Particles

Chaos in Houdini! Modeling Strange Attractors with Particles

For those of you who are familiar with the Lorenz Attractor (Google ''strange attractors'') this fun dive into rendering chaos will be interesting.

Simon Gladman user avatar by
Simon Gladman
·
Aug. 19, 16 · Mobile Zone · Tutorial
Like (1)
Save
Tweet
2.48K Views

Join the DZone community and get the full member experience.

Join For Free



I recently posted Chaos in Swift! Visualizing the Lorenz Attractor with Metal, which was inspired by a Houdini tweet from Erwin Santacruz. It appears that Erwin's solution creates geometry, so I thought I'd look at this from a different perspective to see if I could create a particle based visualization of strange attractors in Houdini.

So, it turns out to be a lot simpler than I expected! 

The secret sauce is the POP Wrangle node. This node runs a VEX expression against every particle and allows Houdini control over each particle's properties such as size, position, and velocity. The number of solves per-frame is controlled by the POP Solver's subsets attributes.

To give my attractors some variance, my projects use very small spheres as the particle source. Once Houdini had created a DOP Network, I've removed gravity, added the POP Wrangle and an instance geometry node for fine control over particle size:

The VEX inside the POP Wrangle nodes isn't a million miles away from my Metal code. The main difference is that for each invocation, it's getting and setting the x, y and z attributes of each particle's position (@P). So, the Hadley attractor POP Wrangle expression is:

float alpha = 0.2;
float beta = 4.0;
float zeta = 8;
float d = 1.0; 
float deltaX = -@P.y * @P.y - @P.z * @P.z - alpha * @P.x + alpha * zeta; 
float deltaY = @P.x * @P.y - beta * @P.x * @P.z - @P.y * d;
float deltaZ = beta * @P.x * @P.y + @P.x * @P.z - @P.z;
@P.x += deltaX / 300.0;
@P.y += deltaY / 300.0; 
@P.z += deltaZ / 300.0;

...and the Lorenz Mod 2 attractor POP Wrangle expression is:

float a = 0.9;
float b = 5;
float c = 9.9;
float d = 1; 
float deltaX = -a * @P.x + @P.y * @P.y - @P.z * @P.z + a * c; 
float deltaY = @P.x * (@P.y - b * @P.z) + d;
float deltaZ = -@P.z + @P.x * (b * @P.y + @P.z);
@P.x += deltaX / 1000.0;
@P.y += deltaY / 1000.0;
@P.z += deltaZ / 1000.0;


The final renders have some depth-of-field and motion-blur added with some nausea inducing camera moves (I'm no cinematographer!). Enjoy!

Houdini (chess) Chaos

Published at DZone with permission of Simon Gladman, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • XAMPP vs WAMP: Which Local Server Is Best?
  • Get Started With Kafka and Docker in 20 Minutes
  • 50 Common Java Errors and How to Avoid Them
  • Back to Basics: Accessing Kubernetes Pods

Comments

Mobile Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo