Getting velocities from moving verticies

At the moment, is there a way in Stoke 2.0 to get velocities from vertices on a deforming mesh a’la Houdini? If so, would you mind pointing me in the right direction?

In Houdini, there’s also a great way to take a mesh and by using the edges you can determine the flow of velocities. I’ll try to show a more specific example, a friend (I even think he’s on the beta) just told me about it the other day. Maybe I’ll ask him to post if he has time. It would be fantastic to get this into Stoke as well (if you can’t already).

I’m looking for a way to do that too. There is this nice tool here:

guillaumeplourde.com/

and it would be really great to use Stoke to add some dynamic foam to it.

I tried copying/pointcaching/offsetting with 1 frame, then subtracting particle position and nearest point on the offset object, and that’s what I get:

dropbox.com/s/pq682kt5nixyt … .38.51.png

Looks good in the lower left corner, but not in the other areas.

Sorry, I was being an idiot :slight_smile: I normalized the vector that goes to color, and I placed the prt surface objects at 0, now it works:

dropbox.com/s/her1mf9pbr0wi … .56.38.png

Still, I don’t really understand why PRTSurface needs to be at 0, when the lookup is done with the worldspace position of the particle - I’ve seen that before too, an explanation would be great.

Thanks!

Interesting, I need to check out what you did and if it works the way I meant with my initial question. Thanks for sharing!

And the really cool part is that once you have the velocity, you can remap it to a color so you only get the downwards part, emit particles from there, and use Stoke for the motion. And voilla - dynamic wavecrests!

Preview:
vimeo.com/81519235

Scene:
dropbox.com/s/c32qn9bjeifqlza/stoke_h4m.rar

Very nice, thanks again for sharing!

Guys, we just added support for Velocity channel from PRT Volume in Krakatoa (upcoming v2.3 build, stay tuned).

Also, you can use the Velocity channel of XMesh (which has the option to copy Velocity to any Map channel) to get velocities from meshes indirectly. In fact, I posted a demo (found under Stoke Development History) a while ago:
youtube.com/watch?feature=pl … zac-Q9yHyc

With Krakatoa having velocity from deforming meshes, I hope it will be relatively straight-forward to support this in Stoke, too. But for the time being, if you have XMesh, use that…

Assuming the PRT Surface is in World Space mode, adding the ToWorld operator to Magma performs double-transformation - it looks at the position of the ICON of the PRT Surface and offsets by that on top of the existing world position. If the particles were in Object space (PRT Surface aligned to the mesh, single mesh picked and World Space unchecked), then you must perform the ToWorld to bring the particles from Object Space of PRT Surface to World Space and perform the NearestPoint lookup.

In the case of Stoke, you don’t need to perform ToWorld after the InputChannel Position because the Position is always in world space anyway.

Thanks for the explanation! And very cool about the XMesh velocities, I hadn’t noticed that!

I have modified the Stoke Magma editor internally to not include a ToWorld when dragging a connection from the Lookup Point (WS) socket to make an InputChannel Position. It works the same but should reduce the clutter a bit…