expresiion help

Hi all,

I need some pointers on a simple expression . . . I’d like to find a way to delete points based on velocity of each point. I’m running live video of a dancer over a green screen, then dropping out the background, feeding in to a Trace SOP and then into a Trail SOP to get velocity. From there into a Particle SOP to generate trails coming from the edges. The idea is to only retain the faster moving elements to allow the dancer to control the trails coming out. I have it sort of working now by taking the velocity and using it as a scale on the particles, but there’s lag as the particles are generated over the whole outline.

Thanks,
Jeff

The easiest way to delete points is using a bounding volume in the Delete SOP.

After the Particle SOP, append a Point SOP. In one of the position parameters (I used position tz since in your setup all point’s tz=0) put an if statement something like this:

if(abs($VX)<0.2||abs($VY)<0.2, 10000, $TZ)

This places the point way off at tz=10000 if any of the velocites are less than 0.2, pick whatever velocity works for your setup. Also, make sure that the points are moving very far from where they are created. Then add a Delete SOP which deletes all points outside a bounding volume. Set the volume size so it does not interfere with the particles you want to keep, but less than the tz you are sending the slow particles to.

If that explanation just confused you, check out the attached example… using a the Geometry Spreadsheet you can follow what’s happening.
velocitycull.tox (87.8 KB)

Hi Ben,

That is exactly what I was looking for, thanks very much !

Jeff