Jump to content
Sign in to follow this  

Heart Beat Vex

Recommended Posts

Hello folks,

i want to simulate a heart beating. And i am really bad at coding so... i managed implementing a sin function and fit it between other values so the heart doesnt get below 0 or the other direction because i connected it to the pscale of single point.

A friend of mine told me to set up a sleep function after one heart beat but we also dont know how. Is there any way to do a complete heart beat algorithm? If i could understand the math behind it parallel it would be awesome too :D


In the end i want it to transfer the position data to a vellum surface.... 


Share this post

Link to post
Share on other sites
Posted (edited)

Hi Max,

you are probably better off by drawing the function as a ramp curve and displace the mesh along its normals.

float f = chf('freq');
float s = chf('scale');
float t = @Time * f;
float disp = chramp('cardio', t);

v@P += v@N * disp * s;

If you upload the heart mesh, perhaps someone can setup a quick vellum simulation, too.


Edited by konstantin magnus

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this