This example demonstrates how to create a flat plane from triangles and then oscillate its vertices to obtain a dynamic surface. Also, the color of vertices will depend on the oscillation amplitude.
This is example
The example is based on the
emptyExample project in openFrameworks. Begin with adding the declaration and definition of the
setNormals() function, as described in the Computing normals using the setNormals() function section. Then in the
testApp.h file, in the
testApp class declaration, add definitions of
ofMesh mesh; //Mesh ofLight light; //Light
In the beginning of the
testApp.cpp file, add constants with vertex grid size:
int W = 100; //Grid size int H = 100; ...