Create dimples when particles collide with the surface
The project files used in this tutorial can be found at:http://dl.dropbox.com/u/3834689/CaffeineAbuse/Dent_by_particle.zip
Extract particle’s positions
Open the scene Dent_Geometry_by_Particles.scn from this issues CD. Select the grid and press [Alt] +  to open an ICE Tree. From the Create menu choose Simulated ICE Tree. Press  to open an Explorer and drag and drop the PointCloud into the ICE Tree. Get a Get Closest Location on Geometry node and a Get Data node. Connect the [PointCloud]:Value —> Geometry1:[Get Closest Location on Geometry]. Open the Get Closest Location on Geometry PPG and set the Cutoff Distance to 0.5. Connect [Get Closest Location on Geometry]:Location to the Source:[Get Data]. Open the Get Data PPG and type PointPosition as reference. The next step is to extract the position for each point on the grid and calculate the distance between the grids points’ position and the particles.
Control the magnitude
Get a Get Data node and type self.PointPosition as reference. Get a Get Distance Between and a Rescale node. Connect [Get self.PointPosition]: Value —> First:[Get Distance Between] and [Get PointPosition]:Value —> Second:[Get Distance Between]. Connect [Get Distance Between]: Result—> Value:[Rescale] and open its PPG. The Rescale node will be used to control the magnitude of the dents. A high value will make the effect of the collision more severe whereas a low value will make it more subtle. The output of the Get Distance Between node is a positive value which means you’ll need to invert it to push the geometry inward rather than outwards. Change the Target End value to -0.35.
Deforming the geometry
Get a Get Data node and set the reference to self.PointNormal Get a Multiply by Scalar node. Connect [Get self.PointNormal]:Value —> Value:[Multiply by Scalar] and [Rescale]:Result—> Factor:[Multiply by Scalar]. This will determine the in which direction the points will be pushed. Get another Get Data node and set the reference to self.PointPosition. Get an Add node and connect the Value output of the [Get self.PointPosition] to the Value1 input of the [Add] and the Result [Multiply by Scalar] to the Value2. Get a Set Data node and set the reference to self.PointPosition. Connect [Add]:Result —> self.PointPosition:[Set Data node] and [Set Data]:Execute —> Port1:[ICE Tree]