class Sphere : public GModule

Class Sphere

Inheritance:


Public Methods

virtual void draw_graphics (void)
Enable all material and lighting properties
virtual void init_graphics (void)
Set lighting and material properties
virtual void kill_graphics (void)
If memory lock has been set, free it.
virtual void preinit_graphics (void)
Initialize memory lock for spheres. Set grid toggle on.
Sphere ()
Constructor
virtual void update_graphics (void)
Update wand parameters.

Private Methods

void draw_balls ()
For each active sound, use sound parameters to draw a sphere
void draw_grid ()
Draw the grid in the center of the hall
void draw_hall ()
Draw the hall for the simulation, mapping a texture to the walls
double get_note_height (double f)
From a frequency value f, calculate and return the height that the note should be drawn
double get_reverb_hue (double x)
From a value x, return a value between 0 and 360 which will be used to calculate a color
void init_balls (void)
Set specific material properties for spheres
void init_grid ()
Calculate coordinates for grid lines
void init_hall ()
Calculate coordinates for hall walls and set normal vectors
void set_color (double cval, double wval, int cflag, int wflag)
Calculate and set a sphere's color
void set_prop_wall ()
Generate a display list to set material properties for the texture map
void set_radius (double radval, double pval1, double pval2, int radflag, int pflag)
Calculate and set the radius and the amount of pulse
void set_rotate (double val, int flag)
Calculate and set the sphere's rotation
void set_scaling (double val, int flag)
Calculate and set the scaling for the radius
void set_xcoord (double xtogl, double xval, int flag)
Calculate and set the sphere's x coordinate
void set_ycoord (double val, int flag)
Calculate and set the sphere's y coordinate
void set_zcoord (double val1, double val2, int flag)
Calculate and set the sphere's z coordinate
void texture_configure ()
Set texture parameters

Inherited from GModule:


Documentation

Class Sphere. Class Sphere is a child of the class GModule. It is one of currently three graphical representations which maps sound parameters to visual parameters. One sphere is drawn per currently active sound.
Sphere()
Constructor. Set initial variable values. Load texture file for mapping on walls.

virtual void preinit_graphics(void)
Initialize memory lock for spheres. Set grid toggle on.

virtual void init_graphics(void)
Set lighting and material properties. If not already done, initialize menu. Call other init routines to initialize hall, grid, and spheres.

virtual void draw_graphics(void)
Enable all material and lighting properties. Call routines to draw the hall, grid, and spheres.

virtual void update_graphics(void)
Update wand parameters.

virtual void kill_graphics(void)
If memory lock has been set, free it.

void init_balls(void)
Set specific material properties for spheres. Called from init_graphics.
See Also:
init_graphics

void init_hall()
Calculate coordinates for hall walls and set normal vectors. Also, calculate texture coordinates. Called from init_graphics.
See Also:
init_graphics

void init_grid()
Calculate coordinates for grid lines. Called from init_graphics.
See Also:
init_graphics

void set_prop_wall()
Generate a display list to set material properties for the texture map. Called from init_hall.
See Also:
init_hall

void texture_configure()
Set texture parameters. Called from init_hall.
See Also:
init_hall

void draw_balls()
For each active sound, use sound parameters to draw a sphere. Called from draw_graphics.
See Also:
draw_graphics

void draw_hall()
Draw the hall for the simulation, mapping a texture to the walls. Called from draw_graphics.
See Also:
draw_graphics

void draw_grid()
Draw the grid in the center of the hall. Called from draw_graphics.
See Also:
draw_graphics

void set_xcoord(double xtogl, double xval, int flag)
Calculate and set the sphere's x coordinate. Called from draw_balls.
Parameters:
xtogl - If one, sound is in the left channel.
xval - Value to calculate the x coordinate.
flag - If true, use xval. Otherwise, use a default.
See Also:
draw_balls

void set_ycoord(double val, int flag)
Calculate and set the sphere's y coordinate. Called from draw_balls.
Parameters:
val - Value to calculate the y coordinate.
flag - If true, use val. Otherwise, use a default.
See Also:
draw_balls

void set_zcoord(double val1, double val2, int flag)
Calculate and set the sphere's z coordinate. Called from draw_balls.
Parameters:
val1 - Value to calculate the z coordinate.
val2 - Value to calculate the z coordinate.
flag - If true, use val1 and val2. Otherwise, use a default.
See Also:
draw_balls

void set_rotate(double val, int flag)
Calculate and set the sphere's rotation. Called from draw_balls.
Parameters:
val - Value to calculate rotation.
flag - If true, use val. Otherwise, use a default.
See Also:
draw_balls

void set_scaling(double val, int flag)
Calculate and set the scaling for the radius. Called from draw_balls.
Parameters:
val - Value to calculate scaling.
flag - If true, use val. Otherwise, use a default.
See Also:
draw_balls

void set_radius(double radval, double pval1, double pval2, int radflag, int pflag)
Calculate and set the radius and the amount of pulse. Called from draw_balls.
Parameters:
radval - Value to calculate radius.
pval1 - Value to calculate pulse.
pval2 - Value to calculate pulse.
radflag - If true, use radval. Otherwise, use a default.
pflag - If true, use pval1 and pval2. Otherwise, use a default.
See Also:
draw_balls

void set_color(double cval, double wval, int cflag, int wflag)
Calculate and set a sphere's color. Called from draw_balls.
Parameters:
cval - Value to calculate base color.
wval - Value to calcualte whiteness of color.
cflag - If true, use cval. Otherwise, use a default.
wfalg - If true, use wval. Otherwise, use a default.
See Also:
draw_balls

double get_reverb_hue(double x)
From a value x, return a value between 0 and 360 which will be used to calculate a color

double get_note_height(double f)
From a frequency value f, calculate and return the height that the note should be drawn


This class has no child classes.

alphabetic index hierarchy of classes


M4cave Sound Visualization

Contacts

M4cave Reference Manual
Help With Doc++

generated by doc++