CUGL
2.0
|
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[]) |
enum cugl::MATERIAL |
Enumeration for materials.
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:
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.
params | specifies:
|
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.
m | is chosen from the enumeration MATERIAL |
face | should be one of GL_FRONT (the default), GL_BACK , or GL_FRONT_AND_BACK . |