Procedural Animation - Cauldron
Path of the scene: [01_procedural/]
This code display a scene in loading some external .obj meshes: A cauldron and a spoon
- Note: The meshes files are stored in the directory assets/. This directory should be accessible from the place where your executable is run.
The goal of this exercise is to modify the code to model a scene similar to the following one.
Bubbles
The particles structures, creation and position update are in the filesparticles/particles.hpp/cpp
. The constructor already creates the bubbles at their expected position.
-
- Update the function
particle_bubble::evaluate_position()
to set the motion of the bubbles.
Smoke billboards
The smoke behavior is obtained using billboards with the semi-transparent smoke texture. To get the expected behavior, you should-
1) Set the constructor
particle_billboard::particle_billboard()
to set the correct initial position of the billboards. -
2) Update the function
particle_billboard::evaluate_position()
to set the correct trajectory of the billboards. -
3) Update in the file
scene.cpp
the functionscene_structure::display_billboard()
in order to the the billboards facing the camera, and with varying transparency along time.
Liquid surface
The liquid surface is modeled by a grid trimmed to fit a circle. The liquid surface is associated to a dedicated shader inshaders/water
.
The animation of the liquid can be made in modifying the associated vertex shader shaders/water/water.vert.glsl
.
-
- A uniform
time
parameter is passed to the shader and can be used to modify the position of the vertices of the grid. -
- A 2D and 3D simplex noise
snoise
is available in the shader. -
- The animation of the surface can be obtained by modifying the function
float deformation(float x, float z, float t)
in the shader. -
- The surface is defined as \(S(x,z)=(x,\text{deformation}(x,z,t),z)\).