Removing and borning points while keeping current positions

Hello. I’m asking for help because I’m not sure which direction I should go. I’m trying to use an effect of smoothly moving points that change their horizontal positions based on an image input, and I managed to create this part. However, I can’t correctly implement the second effect: when the number of active pixels decreases, it removes (moves) the visible ones to the left, outside the screen, and when new points are added, it brings them in from the right toward the center and they take their positions. I tried using TOPs by generating a delta, and I also tried with CHOPs, but I’m still far from an ideal solution.

The two main assumptions are:

  1. Points smoothly transition to new horizontal positions based on the image.

  2. If there are fewer points in the current cycle, the “dead” points move to the left and disappear. If more points are added, a new point is created on the right and flies into its target position. If the number of points stays the same between cycles, nothing flies in or out—only the existing points move to their new positions.I stuck at that project for months, tried different techniques.

I stuck at that project for months, tried different techniques.

Probably tops didnt work here because i cant delate points, but maybe some tables could be fine idk. I want to make like queue where the first point on left is removed to left (once not needed), and when new points is needed than its borned on right side.

td question.toe (5.3 KB)

Hi @Tobek,

does active pixel mean the pixel has a value of greater than 0?
you could think of your pixels as a system with some states:

  • active: the pixel value is greater than 0 and the position is equal to the pixel value
  • dying: the pixel value is 0 and the point is transitioning to a fixed position on the left side of the screen
  • idle: the pixel value is 0 and the point is sitting on the right hand side

These 3 states can be created using Logic CHOPs and a Lag CHOP to simulate the transition from active to idle.
As the 3 states also have their individual positions, you can now multiply the states with position channels and finally add them together to get the points eventual position. Now you can add another Lag CHOP to interpolate between the positions.
Important are two things to consider:

  • only points that are not in the idle state should be lagged
  • the lag values for the two Lag CHOPs used must be identical as otherwise the states would not match the movement in the second lag.

Optionally you can also use a Filter CHOP instead of the Lag CHOP, same thing applies though: the filter width needs to be identical.

It would be possible to also set this up with a POPs particle system. This approach here is just nice and visual to get an idea of the state based system.

Attached is the CHOP solution.

Hope this helps
cheers
Markus
td question.3.toe (5.5 KB)