Pointcloud transformation in partial area only

Hello everyone,
after the awesome “Napoleon dissolved” tutorial by Markus Heckmann I need to find out, if there is a way to transform the pointcloud in a partial area only - like using a sphere as Force source in a particle-SOP? With the threshold-TOP it’s divided in half and you can control where the cut is done, but it’s not so precise like chosing only the head, shoulder or even chose an area interactively (with x, y, z values from a leap-motion for e.g.). I guess the transformation/selection must be applied to the pointfilein-TOP - but how? I would be so happy about any tips or advice! Thank you.

Hey,

you can calculate the distance of each point in the pointcloud to a specific position in a few steps:
subtract the force position simulated by a Constant TOP from the Pointcloud itself. Now use the Math TOP to calculate the length of each point in the cloud by choosing Combine Channels>Length.
With the distance of each point in the cloud to your simulated force position, you now can use the Threshold TOP to create a mask tht covers points in a certain range to the force position. Last, multiply the origina pointcloud with the mask.

Hope this helps
Cheers
Markus
distance2Point.toe (11.3 KB)

2 Likes

Wow! Thank you so much for this helpful answer and example! It worked out very well :smiley:

How can I tell the selected points within my force to follow my force position for a little time?
I guess somehow the current force position needs to be multiplied with the Threshold mask and via feedback blended to the original again?

If you’re looking to apply the same movement to each point, the the Point Transform TOP might be useful for you. You can apply any geometric transform to a point cloud texture and it has a second input that takes a weight (threshold) mask to control what points are affected.

Setting the translate value to a percentage of the distance from the center of your points to the force position and then feeding the outback back through a Feedback TOP would push the point cloud towards the force over time.

If you want your point cloud to converge on your force position then you could create a Constant TOP with the force position and subtract your current point cloud from it to create a vector map. You could then scale that, multiply in your threshold mask, and then add it back to your point cloud to make each point move independently to your force.

Hope that helps. fyi, there is also a pointWeight component in the palette that you might find useful for generating weight / threshold masks.

1 Like

Thank you for your answer!
The points should just be a little sticky or magentic to the moving force - when it moves close to or into the pointcloud.
What do you mean by “setting the translate value to a percentage of the distance from the center of your points to the force position”? And how do I get this distance or this percentage? As the solution for my first question I already subtracted my constant from the pointcloud to create the threshold mask with a certain distance around my constant. But how do I porgress with this?
Feeding through a feedback means: output of the pointtransform 1. into a feedback and level and 2. into an add TOP?

Honestly I would need examples or screenshots to follow your explanations - guess I am a beginner still in this field.

I’ve attached a small example project that shows some ideas on how you can get the selected portion of the point cloud to follow a target. They’re just to show some concepts and aren’t necessarily the best or only ways of doing it.

In one case I’m using an analyze top to figure out the current average position of the selected point cloud and then using some chops to calculate how much I need to move it towards the target pos. I’m using a point transform with the weight input to apply that movement to just the selected points.

In the second case I’m using Subtract, Add and Math tops to move each particle towards the target individually. In this simple case, this would lead to the point cloud converging so I added some noise to scatter it out.

In both cases I’m using the pointWeight component to select the points, but in one case it has no falloff so that the selection has hard edges, and the other has a linear falloff so that some points are less affected than others.

Hope that at least gives you a starting point to explore things.

pointCloudFollow.toe (15.5 KB)