![]() |
||
|
ArrayMapper And Ramp zj, Apr 2003
Here is a test animation of the tornado effect. Background An arrayMapper is a node used for mapping array attribute to the color attributes of texture nodes. Typically used by particle objects to invoke color values from the texture node for each particle.
Maybe the most often useage of the arrayMapper is applying a ramp color to particle's rgbPP. Each particle changes its color when traveling from birth to death.
But how it works? Each particle sends its normalizedAge to the arrayMapper, which converts the age to Vcoordinate of the ramp, and returns the rampColor to particle's color. Goal A friend of mine asks me for solution to create a tornado, and he wants to use a curve to control the position and shape of it.
Solution The biggest challenge is to collect the curve information correctly. We need a large number of pointOnCurveInfo nodes to sample the curve and interpolate the values at the points between them. I leave the exhausting job to a MEL script named "curvefield". Select a curve and "create" two colorRamp nodes, which containing the position and targent information of the curve.
Add two userVectorPP attributes to the particle.
Connect the Ramps created by the MEL to their arrayMappers instead.
Now the two user-defined per-particle attributes are ready to be used in the particle expressions. I write a runtime velocity expression like this and get a tornado. |
||