Point follow curve with simulation nodes?

I’m doing something that should be quite simple- I’d like to have a point on a curve circle move along that curve circle in simulation nodes. This is easy in non-simulation nodes; just use a Sample Curve node and change the factor over time. However, this method doesn’t work in simulation nodes. I tried Curve to Points as well, which tells me that the source is an invalid Point Cloud… which doesn’t make a lick of sense to me, since it’s definitely not a point cloud :thinking:

My file is extremely simple- I’m just deforming a curve circle primitive over time:

seagulls.blend (4.9 MB)

To summarize- I want to move a point along a curve circle primitive in simulation nodes. Any ideas?

Or, if this makes more sense, I want to do this in simulation nodes:

If you add simulation nodes to the above setup and modify the Curve Circle during simulation, that setup no longer works. So, I’m looking for an alternative that can use a simulation-affected curve circle.

Adding those nodes to a simulation creates a weird tearing effect and the Sample Curve node thinks the Curve is a Mesh(?!?) now, but Mesh to Curve gives the invalid Point Cloud error again… :grimacing:

1 Like

hmm… can you use the output of the simulation nodes as an input to the sample curve, outside the simulation nodes?

ahh… nebbermine, i think … it just worked out in my head that the curve is changing length in the simulation, which would give odd results in the sample curve… your factor wouldn’t move smoothly due the changing length, much like trying to keep an even tempo while your reel-to-reel is stretching the tape. :smiley:

2 Likes

Yeah, my results match your estimation. I know there’s a simple, easy, answer to this, I just can’t figure it out :sweat_smile:

This! :point_up:

@joseph: Since you’re doing Simulation Nodes, you’ll need to do a Simulation… A Simulation that makes sense is to move the point using some dynamics formula using the sample nearest node to “force” the point simultaneously closer to the curve and along its Tangent.

I can do a demo if you’d like.

1 Like

Wow, that sounds like it would work! But… yeah… you lost me :sweat_smile: Can you show me how to do that, please?

that sounds so much simpler than solutions rattling in my head…

currently i’m on the thought process of delinking the curve and object, and rather have the object move it’s _distance/frame .toward. the nearest point on curve. so it’d always be playing catchup, but still follow the idea of the curve. much like pathfinding with a constantly changing path. but the vector math needed threatens to melt what few brain cells i have left. :smiley:

1 Like

I love it when very simple ideas in my head turn out to require an advanced math degree to implement :wink: Thanks for your brainpower here, I appreciate you and zeroskilz jumping in to help

Hold your thanks till I have a solution… I’ve gotten the point to dynamically move to the closest point on the curve, but moving along the tangent doesn’t seem to update the sample nearest…

Will report back when I have it working.

1 Like

Sorry, did this in Alpha 4.0 so hope you can open it OK, lemme know if you have issues:
curve follow dynamics.blend (87.8 KB)


It kinda works but can probably be improved :man_shrugging:

It does tho kinda get the idea across.

Good luck!

5 Likes

do you mean like this?
move on curve

1 Like

@zeroskilz wow, I don’t understand this at all, but it does work, thanks!!!

@Blender_Fun1 yes- how did you do that?

One simple way (though for the general case you’d need to adjust to avoid an offset) is to on each step add the difference between the previous factor position and the current one, like this:

2 Likes

i just added the “normal” follow path nodes to the end (outside) of the simulation:

3 Likes

Just remember that velocity is change in position (p(t)=p(t-1)+v), and force is related to acceleration (F=ma) and acceleration is change in velocity (v(t)=v(t-1)+a).

So in my calculations the scaling at the end of the “Force” bit is for the “mass” of the point.

Good luck.

2 Likes

Thanks for all the offered solutions, especially @zeroskilz for going the extra mile (I’ll be dissecting your nodes and learning from them for sure!) I wish I could offer multiple solutions, but in this case, @Blender_Fun1 had the solution that seems to be working best for my use case :slight_smile:

3 Likes

This is the end result (I always like when people do this on solved posts):

I wanted curve paths that slowly change over time with seagulls (haven’t got there yet!) following them, like a flock of seabirds wheeling over a beach. These are the nodes, if anyone wants to replicate this:

5 Likes

This is coming along nicely (I still need to animate the gulls, obviously), but I’m running into difficulties figuring out the math to keep the gulls pointed along the path they’re following while maintaining Z-Up-ness. I’ll probably make another thread about that, but just in case anyone’s still hanging around here, any thoughts?

Assuming you’re keeping things as points and then adding instances at the end… if so, just align (Align Euler to Vector) with the Tangent from the Sample Curve.

2 Likes

can you store last position to compare with current position, and use that vector/direction to align on just x/y axis? if you also store that vector/direction each frame, i’m thinking there’s some ridiculously complicated vector math to see the difference between the two, and use that to calculate banking as well. unfortunately, my ideas have far outgrown my math skills from 40 years ago. :smiley: all i remember is 2 + 2 = 5

for large values of 2 …grins…

1 Like

You’re right (again), I had tried this earlier but for some reason it only works if I set the axis to Y. No idea why but I’m not going to look too closely :sweat_smile:

@KDLynch that sounds like a great idea, and if Align Euler to Vector ends up breaking, I’ll look into that :slight_smile:

But yeah, I think I can call this fixed:

4 Likes