0
$\begingroup$

I have a bunch of points distributed randomly by a noise texture, and another point acting as cursor, which positions itself on each point, every 30 frames.

I'm looking for a way to ease/smooth the motion of this point as a function of time.

Currently, the cursor "teleports" instantaneously from one point to another, but I'd like it to move slowly during the 30 frames of the loop.

I can't quite grasp the mechanics involved. I'd imagine I'd need to set up a simulation zone, retrieve the current coordinates of the point, then add (or compare?) those of the next point, tell the cursor "go from there, to there, along this vector divided in 30 intermediate values" but it's all a bit confusing as to how to build the node tree.

Thanks.

random points and cursor

$\endgroup$
2
  • $\begingroup$ While this is possible, you'd just be recreating existing physics systems. The physics solution is easier to setup-- there's no need to recreate it in GN. Are you interested in the physics-based solution to your problem, or only in a GN solution? $\endgroup$
    – Nathan
    Nov 30, 2023 at 17:24
  • $\begingroup$ It's a GN issue only (it's a small part of a greater GN parametric setup), but my curiosity wants me to hear the physics-based solution. $\endgroup$
    – CDRX
    Nov 30, 2023 at 18:14

1 Answer 1

0
$\begingroup$

To solve problems like this, we can recreate physics in GN, which is possible but tedious, or we could just use the existing physics system that comes with Blender:

enter image description here

To recreate a "stepped" animation, I've animated an empty, then constrained it to the nearest vertex of a grid. This gives me a very jumpy animation.

To smooth this out, I use a soft body physics triangle. I parent this triangle to the empty, give it soft body physics, and then tune the "goal" parameters to control how forcefully the triangle is drawn to its parent. Although the triangle is centered on the empty at frame 1, we can see that here, a few frames in, it no longer is-- it's following the empty smoothly, with inertia, drawn to the position of the empty only by the force exerted by its goal settings.

I've also set the force of gravity to 0 on the soft body in its field settings. We could, alternately, just change the force of scene gravity to 0. If using with other physics in the same scene, you may wish to disable other kinds of forces as well.

Then, I vertex (triangle) parent my rendering mesh (Suzanne, as always) to this soft body triangle. The soft body itself can be disabled in renders.

We can do the same setup following GN modifiers if we'd like, although exactly what we need to do depends on the nature of our "cursor". If we make the cursor an object consisting only of a single vertex, we can simply shrinkwrap the empty to the nearest vertex of that cursor object. If the cursor is a manipulation of base geo, rather than generated entirely within GN, we could also copy location by a vertex group assigned to that geo. If those don't work, we can make a new, single vertex object and use GN to copy the mean location of the cursor geometry and then shrinkwrap or copy location that new single vertex.

This is a pretty easy setup for smoothing anything out. While we could do something similar with rigid body physics, it's often easier, in Blender, to set up simple systems like this with soft body physics (we create "constraints" on the physics by virtue of the topology used; we can rely on a simple, smooth "goal" rather than a carefully tuned spring.) And of course the performance cost of calculating physics on a single triangle, without any collision, is pretty close to nil.

$\endgroup$
1
  • $\begingroup$ That's really clever. I wonder if could switch from my GN setup to this solution... This could solve many upcoming issues as well. In any case, it's an option worth exploring. Thank you so much for your comprehensive and educational reply. $\endgroup$
    – CDRX
    Dec 1, 2023 at 9:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .