Geometry/Simulation Nodes: How to store previous location in the most simple way?

Hi there!

I’m trying to figure out, how to get a vector between the current and previous locations of a moving object, using Geometry Nodes. And for some reason, nothing I have built so far seems to work. One thing is that it becomes unclear, whether the order of things in GN is going exactly in the sequence as needed. Because as they are there now, I bet they don’t really have left to right hierarchy uuuugh.

Any tips will be greatly appreciated!

Basically, I know that in my example, it’s all happening at once. I need to figure out, how to make this into a sequence…?

You can make use of the scene time node to create a sequence…

1 Like

Hm, with modulo and some simple switch? It’s weird I can’t find any tutorials or posts on this. It seems like a very basic thing that many ppl must have been making, to measure speed etc?

You can look at some of the stuff Cartesian Caramel does on his YT.

Simulations are new, so you have to write yr own solvers.

Heres a sandune one I made, have a look.

Hope that helps

I definitely see the point, that with scene time, I could sort of make a short-lived memory saved as an array. I’m just often suspicious, that my solutions are a bit redundant. Thank you for the direction!

Not really sure what you’re trying to do-- seeing everything would probably help.

But here’s an example where I’m using the location of the object to determine the object velocity and instancing Suzanne based on that velocity:

locationSim.blend (130.4 KB)

Hopefully you can adapt that to what you need.

Edit: should be said, using GN to do this is not the simplest way; we’re storing the location of the object on every single vertex of the mesh, when we only need to store it once. If all we need is the location now and the location one frame ago, the simplest way is with an empty with the same action, offset a single frame-- we can compare the locations of each, perhaps with a driven custom property.

1 Like

I just got back to the computer and I tested this idea below. Which also seems to work and the backlog memory is determined by the number of indexes on the Curve Line.


1 Like

Any idea, why this doesn’t work? When I try to read a specific and preceding vector location from the sheet…

Just plug the subtract node to the index input in Sample Index node. It doesn’t work because Curve Line node only accepts single values instead of fields

1 Like

Yes! Plus one modulo operation was missing. So here is the final solution.

1 Like