Deformation, that is, changing the geometry of a surface, gives an opportunity to create new and unusual 3D shapes. We will explore two methods of deformation: shifting the sphere's vertices using analytical formulas and extruding the sphere's surface using a texture's pixels values.
To implement this, let's start with adding several sliders to control deformation in the following way:
Declare new sliders in the
ofApp
class:ofxFloatSlider rad, deform, deformFreq, extrude;
This line declares four sliders: sphere radius, amount and frequency of analytical deformation, and amount of extrusion.
Add commands to set up sliders to
setup()
after themixerGroup.add( show3d.setup...
command:mixerGroup.add( rad.setup("rad", 250, 0, 500) ); mixerGroup.add( deform.setup("deform", 0.3, 0, 1.5) ); mixerGroup.add( deformFreq.setup("deformFreq", 3, 0, 10) ); mixerGroup.add( extrude.setup("extrude", 1, 0, 1 ) );