jeudi 31 octobre 2013

Clumping and clump borders

A method I found to find clump borders.

1 Create a Sphere

2 Create a Pointcloud, Emit 10 particles from the Sphere (Emit from Geometry) and call that Pointcloud "BaseEmitter"


3 Create a new PoinCloud, Emit 10000 particles from the Sphere (Emit from Geometry).
Using GetClosestLocationFromGeometry, get particles datas from "BaseEmitter" such as color, so you can visualize what it's doing. See, it's making large beautifull colored areas :)
What we want, is find the border of these areas
 This way of doing things was taught from my friend Nika Ragua on vimeo https://vimeo.com/69505473

4 We're also getting the BaseEmitter ID and storing them as Self.Clump
See, each particle has a number corresponding to the area it is belonging to.

5 With a GetNeighboringParticles we're getting that Clump value.
The idea here is that, now every particle is aware of the Clump value of its closest neighbor.
We're storing that value as ClumpNeighbor
6 Now, We're Subtracting the Clump from ClumpNeighbor
The idea here is that if result is different from zero, it means we're on a border !
Now look, every "1" is showing the border.
 7 That's good, but there's a problem. It's working for one (1) neighbor per particle, but if you want more neighbor (thicker border) you'll end dealing with arrays per particles.
(Max Neighbor =5 for the example)

8 Let's filter that ! Border!

Aucun commentaire: