The network required for the effect only requires a handful of nodes, let's dive in an take a look:
- Much like my metaball morphogenesis project, this network requires a sphere to act as a scaffold for the overall effect. Its primitive type needs to be set to something other than primitive so that it outputs data for each vertex. Mine happens to be a polygon mesh.
- Even though the sphere node returns data for each vertex, it doesn't return normals. I need these to align the transform for each cone, hence the normal node.
- An additional scatter node jitters the positions of the points and allows me to control the exact count.
- The wrangle node adds some VEX to move each point based on a Perlin noise function.
- The cone, which will be distributed across the sphere's surface is simply a tube with one of its radii set to zero.
- Finally, the copy node copies and distributes the cone over the sphere at the locations of the transformed points.
The VEX in the wrangle node is pretty basic stuff. It uses the the position of each point and the time to generate a random value using the noise function. That value is multiplied by the normal value for each point to calculate its new position:
vector4 pos;pos.x = @P.x;
pos.y = @P.y;
pos.z = @P.z;
pos.w = @Time;
vector rnd = noise(pos);
@P.x += @N.x * rnd.z * 2;
@P.y += @N.y * rnd.z * 2;
@P.z += @N.z * rnd.z * 2;Adding a material with displacement gives a great result too:
Enjoy!
This comment has been removed by the author.
ReplyDelete