A basic geometric visualization
For our first visualization, we'll create a basic equalizer wave graphic. It'll be a rectangular block consisting of a series of cubes that are scaled according to the audio waveform data. We'll use the built-in Cube
component already in the RenderBox
library and its basic vertex color lighting material.
In the visualizations/
folder, create a new Java class named GeometricVisualization
and begin as follows:
public class GeometricVisualization extends Visualization { static final String TAG = "GeometricVisualization"; public GeometricVisualization(VisualizerBox visualizerBox) { super(visualizerBox); } }
At the top of the class, declare a Transform
array of cube transforms and the corresponding array for RenderObjects
:
Transform[] cubes; Cube[] cubeRenderers;
Then, initialize them in the setup
method. We'll allocate the array of cubes, aligned and scaled as an adjacent set of blocks, creating a 3D representation...