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
My file is extremely simple- I’m just deforming a curve circle primitive over time:
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…
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.
@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.
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.
I love it when very simple ideas in my head turn out to require an advanced math degree to implement 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…
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:
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.
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
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:
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.
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. all i remember is 2 + 2 = 5
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
@KDLynch that sounds like a great idea, and if Align Euler to Vector ends up breaking, I’ll look into that