This week, our assigned homework was to recreate a waterfall simulation using a combination of gaol weights and the rain effect we created in week 2. This technique is similar to the waterfalls created in the film Avatar.
A surface was used to emit particles so that they fell over the edge, just like a waterfall. I ran into several complications, mainly with the expression editor. Firstly, the particles were created and emitted from the water surface. Next goal weights were assigned to the surface that I named ‘waterSurface’. The weight was set to 0.7 so that the particles were not heavily affected by goal.
Several expressions were created so that the particles would move off the waterSurface and fall like a waterfall. This was the most challenging part as I have difficulty understanding expressions and do not completely understand them. Fortunately after some time looking over my notes and attempting different methods, I was able to force the particles to move off the surface and fall like a waterfall.
My final creation expression read;
“particleShape1.goalV = particleShape1.parentV;
particleShape1.goalU = particleShape1.parentU;
particleShape1.lifespanPP = 0;
particleShape1.lifespanPP = 1;
particleShape1.randSpeed = rand(0.008,0.02);”
This expression allowed the particles to recognise their position so they would be able to move across the surface. It then killed off the particles after one second (the lifespan mode was set to “LifespanPP Only”). It also allowed each particle to move at a separate speed between 0.008 and 0.02. This wasn’t the only part of the expression. A runtime before dynamics expression was also created to help the particles move across the plane and fall off it. This expression read;
“particleShape1.goalU += particleShape1.randSpeed;
if (particleShape1.goalU >0.99)
particleShape1.goalPP = 0;
This allowed the particles to move freely across the waterSurface, each with its own assigned speed and then off the surface like a waterfall. Finally, several types of fields were created to affect the particles once they left the surface so they fell like water off the side of a cliff. A gravity field was created first. Its magnitude was set to 9.8, but the conserve was set to 0.9 so that it was completely affected by the gravity field. Next, an airfield and turbulence field were created to give the particles a more random effect when they fell. The airfield’s magnitude was set to 100 and the direction 0.5 in the x axis and -1 in the z axis. It’s attenuation was set to 0 so it would have no effect. The turbulence field’s attenuation was also set to 0 and an expression placed into its magnitude. It read;
“turbulenceField1.magnitude = rand(50,75);”
This randomised the magnitude of the field
The final field added was a uniform field. It too had its attenuation set to 0 and an expression in its magnitude which read;
uniformField1.magnitude = rand(10,20);
This randomised the magnitude of the field like the turbulence field.
Finally, a ramp was placed into the opacity of the particleShape so that the particles faded as they reached the end of their lifespan. This helped simulate an actual waterfall as the water fades away into mist as it falls. This is the final result I was able to create using the techniques I described.