Materials and Models


Enumerations

enum  cugl::MATERIAL {
  cugl::BLACK, cugl::WHITE, cugl::RED, cugl::GREEN,
  cugl::BLUE, cugl::METAL, cugl::GLASS, cugl::BRASS,
  cugl::BRONZE, cugl::POLISHED_BRONZE, cugl::CHROME, cugl::COPPER,
  cugl::POLISHED_COPPER, cugl::GOLD, cugl::POLISHED_GOLD, cugl::PEWTER,
  cugl::SILVER, cugl::POLISHED_SILVER, cugl::EMERALD, cugl::JADE,
  cugl::OBSIDIAN, cugl::PEARL, cugl::RUBY, cugl::TURQUOISE,
  cugl::BLACK_PLASTIC, cugl::BLACK_RUBBER, cugl::LAST_VALUE
}

Functions

void cugl::axes (GLfloat size=1)
void cugl::buildPlane (bool shadow=false)
GLuint cugl::makePlaneList (bool shadow=false)
void cugl::setMaterial (const int m, GLenum face=GL_FRONT)
int cugl::addMaterial (GLfloat ambR, GLfloat ambG, GLfloat ambB, GLfloat ambA, GLfloat difR, GLfloat difG, GLfloat difB, GLfloat difA, GLfloat speR, GLfloat speG, GLfloat speB, GLfloat speA, GLfloat shine)
int cugl::addMaterial (GLfloat params[])

Enumeration Type Documentation

enum cugl::MATERIAL

Enumeration for materials.

Enumerator:
BLACK  Black.
WHITE  White.
RED  Red.
GREEN  Green.
BLUE  Blue.
METAL  General metallic colour.
GLASS  General transparent marterial.
BRASS  Brass.
BRONZE  Matt bronze.
POLISHED_BRONZE  Polished bronze.
CHROME  Chrome.
COPPER  Matt copper.
POLISHED_COPPER  Polished copper.
GOLD  Matt gold.
POLISHED_GOLD  Polished gold.
PEWTER  Pewter.
SILVER  Matt silver.
POLISHED_SILVER  Polished silver.
EMERALD  Emerald.
JADE  Jade.
OBSIDIAN  Obsidian.
PEARL  Pearl.
RUBY  Ruby.
TURQUOISE  Turquoise.
BLACK_PLASTIC  Black plastic.
BLACK_RUBBER  Black rubber.
LAST_VALUE 

Definition at line 2324 of file cugl.h.


Function Documentation

int cugl::addMaterial ( GLfloat  params[]  ) 

Add a material to the set of built-in materials. The array of material has a fixed size of 100. An attempt to create more than 100 materials will fail.

Parameters:
params specifies:
  • RGBA values for ambient light
  • RGBA values for diffuse light
  • RGBA values for specular light
  • Value for shininess exponent
Returns:
the index of the new material.

int cugl::addMaterial ( GLfloat  ambR,
GLfloat  ambG,
GLfloat  ambB,
GLfloat  ambA,
GLfloat  difR,
GLfloat  difG,
GLfloat  difB,
GLfloat  difA,
GLfloat  speR,
GLfloat  speG,
GLfloat  speB,
GLfloat  speA,
GLfloat  shine 
)

Add a material to the set of built-in materials. The array of material has a fixed size of 100. An attempt to create more than 100 materials will fail. The parameters specify:

void cugl::axes ( GLfloat  size = 1  ) 

Draw coordinate axes. This function draws the three principal axes in the current position, using size to determine the length of each axis. The axes are colour-coded: X = red, Y = green, Z = blue.

void cugl::buildPlane ( bool  shadow = false  ) 

Draw an aircraft. The argument determines whether the plane is drawn with a metallic colour (shadow = false, the default) or black, to act as a shadow (shadow = true). The aircraft is built using Bezier surfaces. If you use glScalef to change its size, you must enable GL_NORMALIZE to correct the normals. Otherwise, the lighting will be wrong.

GLuint cugl::makePlaneList ( bool  shadow = false  ) 

Construct a GL call list for the aircraft and return its index.

void cugl::setMaterial ( const int  m,
GLenum  face = GL_FRONT 
)

Set material values from the enumeration.

Parameters:
m is chosen from the enumeration MATERIAL
face should be one of GL_FRONT (the default), GL_BACK, or GL_FRONT_AND_BACK.


Generated on Wed Sep 12 14:31:41 2007 for CUGL by  doxygen 1.5.2