CSCI441 OpenGL Library 5.9.0
CS@Mines CSCI441 Computer Graphics Course Library
Loading...
Searching...
No Matches
Classes | Functions
CSCI441 Namespace Reference

CSCI441 Helper Functions for OpenGL. More...

Classes

class  ArcballCam
 A camera that implements an ArcBall camera model. More...
 
class  Camera
 Abstract Class to represent a synthetic camera. The following methods must be overridden:
More...
 
class  ComputeShaderProgram
 Handles registration and compilation of Compute Shaders. More...
 
class  FixedCam
 A camera that can be positioned and oriented but never moved or rotated. More...
 
class  FreeCam
 A camera that implements a FreeCam camera model. More...
 
class  HUDCamera
 creates a 2D Orthographic projection camera used for Heads Up Display overlays More...
 
class  MD5Camera
 A camera that implements the MD5Camera specification. More...
 
class  MD5Model
 stores a Doom3 MD5 Mesh + Animation More...
 
class  ModelLoader
 Loads object models from file and renders using VBOs/VAOs. More...
 
class  OpenGL3DEngine
 Abstract Class to run an OpenGL application with a 3D environment.

Creates and contains a default ArcballCam implementation, tracks the status of the left mouse button, shift key, and mouse position.

The following methods must be overridden:
More...
 
class  OpenGLEngine
 Abstract Class to run an OpenGL application. The following methods must be overridden:
More...
 
class  OrthographicCamera
 Abstract Class to represent an orthographic camera. Stores box clip planes. More...
 
class  PerspectiveCamera
 Abstract Class to represent a perspective camera. Stores aspect ratio and field of view. More...
 
class  ShaderProgram
 Handles registration and compilation of Shaders. More...
 
class  ShaderProgramPipeline
 Handles registration and compilation of Shader Program Pipelines. More...
 
class  UniformBufferObject
 Storage of UBO related data. More...
 

Functions

void setVertexAttributeLocations (GLint positionLocation, GLint normalLocation=-1, GLint texCoordLocation=-1)
 Sets the attribute locations for vertex positions, normals, and texture coordinates.
 
void deleteObjectVAOs ()
 deletes the VAOs stored for all object types
 
void deleteObjectVBOs ()
 deletes the VBOs stored for all object types
 
void drawSolidCone (GLfloat base, GLfloat height, GLint stacks, GLint slices)
 Draws a solid cone.
 
void drawWireCone (GLfloat base, GLfloat height, GLint stacks, GLint slices)
 Draws a wireframe cone.
 
void drawSolidCube (GLfloat sideLength)
 Calls through to drawSolidCubeIndexed()
 
void drawSolidCubeFlat (GLfloat sideLength)
 Draws a solid cube with normals aligned with cube face.
 
void drawSolidCubeIndexed (GLfloat sideLength)
 Draws a solid cube.
 
void drawSolidCubeTextured (GLfloat sideLength)
 Draws a solid textured cube. Calls through to drawSolidCubeFlat()
 
void drawWireCube (GLfloat sideLength)
 Draws a wireframe cube.
 
void drawCubeMap (GLfloat sideLength)
 Draws a cube with 3D Texture Coordinates to map a cube map texture to it.
 
void drawSolidCylinder (GLfloat base, GLfloat top, GLfloat height, GLint stacks, GLint slices)
 Draws a solid open ended cylinder.
 
void drawWireCylinder (GLfloat base, GLfloat top, GLfloat height, GLint stacks, GLint slices)
 Draws a wireframe open ended cylinder.
 
void drawSolidDisk (GLfloat inner, GLfloat outer, GLint slices, GLint rings)
 Draws a solid disk.
 
void drawWireDisk (GLfloat inner, GLfloat outer, GLint slices, GLint rings)
 Draws a wireframe disk.
 
void drawSolidPartialDisk (GLfloat inner, GLfloat outer, GLint slices, GLint rings, GLfloat start, GLfloat sweep)
 Draws part of a solid disk.
 
void drawWirePartialDisk (GLfloat inner, GLfloat outer, GLint slices, GLint rings, GLfloat start, GLfloat sweep)
 Draws part of a wireframe disk.
 
void drawSolidSphere (GLfloat radius, GLint stacks, GLint slices)
 Draws a solid sphere.
 
void drawWireSphere (GLfloat radius, GLint stacks, GLint slices)
 Draws a wireframe sphere.
 
void drawSolidHalfSphere (GLfloat radius, GLint stacks, GLint slices)
 Draws a solid half sphere with a bottom.
 
void drawWireHalfSphere (GLfloat radius, GLint stacks, GLint slices)
 Draws a wireframe half sphere with a bottom.
 
void drawSolidDome (GLfloat radius, GLint stacks, GLint slices)
 Draws a solid dome.
 
void drawWireDome (GLfloat radius, GLint stacks, GLint slices)
 Draws a wireframe dome.
 
void drawSolidTeapot (GLfloat unused=1.0f)
 Draws a solid teapot.
 
void drawWireTeapot (GLfloat unused=1.0f)
 Draws a wireframe teapot.
 
void drawSolidTorus (GLfloat innerRadius, GLfloat outerRadius, GLint sides, GLint rings)
 Draws a solid torus.
 
void drawWireTorus (GLfloat innerRadius, GLfloat outerRadius, GLint sides, GLint rings)
 Draws a wireframe torus.
 

Detailed Description

CSCI441 Helper Functions for OpenGL.

Function Documentation

◆ drawCubeMap()

void CSCI441::drawCubeMap ( GLfloat  sideLength)
inline

Draws a cube with 3D Texture Coordinates to map a cube map texture to it.

Parameters
sideLengthlength of the edge of the cube
Precondition
sideLength must be greater than zero
Note
The origin is at the cube's center of mass. Cube is oriented with our XYZ axes

◆ drawSolidCone()

void CSCI441::drawSolidCone ( GLfloat  base,
GLfloat  height,
GLint  stacks,
GLint  slices 
)
inline

Draws a solid cone.

Parameters
baseradius of the base of the cone
heightheight of the cone from the base to the tip
stacksresolution of the number of steps rotated around the central axis of the cone
slicesresolution of the number of steps to take along the height
Precondition
base must be greater than zero
height must be greater than zero
stacks must be greater than zero
slices must be greater than two
Note
Cone is oriented along the y-axis with the origin along the base of the cone

◆ drawSolidCube()

void CSCI441::drawSolidCube ( GLfloat  sideLength)
inline

Calls through to drawSolidCubeIndexed()

Parameters
sideLengthlength of the edge of the cube
Precondition
sideLength must be greater than zero

◆ drawSolidCubeFlat()

void CSCI441::drawSolidCubeFlat ( GLfloat  sideLength)
inline

Draws a solid cube with normals aligned with cube face.

Parameters
sideLengthlength of the edge of the cube
Precondition
sideLength must be greater than zero
Note
The origin is at the cube's center of mass. Cube is oriented with our XYZ axes

◆ drawSolidCubeIndexed()

void CSCI441::drawSolidCubeIndexed ( GLfloat  sideLength)
inline

Draws a solid cube.

Parameters
sideLengthlength of the edge of the cube
Precondition
sideLength must be greater than zero
Note
The origin is at the cube's center of mass. Cube is oriented with our XYZ axes

◆ drawSolidCubeTextured()

void CSCI441::drawSolidCubeTextured ( GLfloat  sideLength)
inline

Draws a solid textured cube. Calls through to drawSolidCubeFlat()

Parameters
sideLengthlength of the edge of the cube
Precondition
sideLength must be greater than zero
Note
The origin is at the cube's center of mass. Cube is oriented with our XYZ axes

◆ drawSolidCylinder()

void CSCI441::drawSolidCylinder ( GLfloat  base,
GLfloat  top,
GLfloat  height,
GLint  stacks,
GLint  slices 
)
inline

Draws a solid open ended cylinder.

Parameters
baseradius of the base of the cylinder
topradius of the top of the cylinder
heightheight of the cylinder from the base to the top
stacksresolution of the number of steps rotated around the central axis of the cylinder
slicesresolution of the number of steps to take along the height
Precondition
either: (1) base is greater than zero and top is greater than or equal to zero or (2) base is greater than or equal to zero and top is greater than zero
height must be greater than zero
stacks must be greater than zero
slices must be greater than two
Note
Cylinder is oriented along the y-axis with the origin along the base

◆ drawSolidDisk()

void CSCI441::drawSolidDisk ( GLfloat  inner,
GLfloat  outer,
GLint  slices,
GLint  rings 
)
inline

Draws a solid disk.

Parameters
innerequivalent to the width of the disk
outerradius from the center of the disk to the center of the ring
slicesresolution of the number of steps rotated along the disk
ringsresolution of the number of steps to take along the disk width
Precondition
inner is greater than or equal to zero
outer is greater than zero
outer is greater than inner
slices is greater than two
rings is greater than zero
Note
Disk is drawn in the XY plane with the origin at its center

◆ drawSolidDome()

void CSCI441::drawSolidDome ( GLfloat  radius,
GLint  stacks,
GLint  slices 
)
inline

Draws a solid dome.

Parameters
radiusradius of the dome
stacksresolution of the number of steps to take along theta (rotate around Y-axis)
slicesresolution of the number of steps to take along phi (rotate around X- or Z-axis)
Precondition
radius must be greater than 0
stacks must be greater than 2
slices must be greater than 2
Note
Origin is at the center of the dome

◆ drawSolidHalfSphere()

void CSCI441::drawSolidHalfSphere ( GLfloat  radius,
GLint  stacks,
GLint  slices 
)
inline

Draws a solid half sphere with a bottom.

Parameters
radiusradius of the sphere
stacksresolution of the number of steps to take along theta (rotate around Y-axis)
slicesresolution of the number of steps to take along phi (rotate around X- or Z-axis)
Precondition
radius must be greater than 0
stacks must be greater than 2
slices must be greater than 2
Note
Origin is at the center of the sphere

◆ drawSolidPartialDisk()

void CSCI441::drawSolidPartialDisk ( GLfloat  inner,
GLfloat  outer,
GLint  slices,
GLint  rings,
GLfloat  start,
GLfloat  sweep 
)
inline

Draws part of a solid disk.

Parameters
innerequivalent to the width of the disk
outerradius from the center of the disk to the center of the ring
slicesresolution of the number of steps rotated along the disk
ringsresolution of the number of steps to take along the disk width
startangle in degrees to start the disk at
sweepdistance in degrees to rotate through
Precondition
inner is greater than or equal to zero
outer is greater than zero
outer is greater than inner
slices is greater than two
rings is greater than zero
start is between [0, 360]
sweep is between [0, 360]
Note
Disk is drawn in the XY plane with the origin at its center

◆ drawSolidSphere()

void CSCI441::drawSolidSphere ( GLfloat  radius,
GLint  stacks,
GLint  slices 
)
inline

Draws a solid sphere.

Parameters
radiusradius of the sphere
stacksresolution of the number of steps to take along theta (rotate around Y-axis)
slicesresolution of the number of steps to take along phi (rotate around X- or Z-axis)
Precondition
radius must be greater than 0
stacks must be greater than 2
slices must be greater than 2
Note
Origin is at the center of the sphere

◆ drawSolidTeapot()

void CSCI441::drawSolidTeapot ( GLfloat  unused = 1.0f)
inline

Draws a solid teapot.

Parameters
unusedpresent for historical compatability
Precondition
size must be greater than zero
Note
Oriented with spout and handle running along X-axis, cap and bottom along Y-axis. Origin is at the center of the teapot

◆ drawSolidTorus()

void CSCI441::drawSolidTorus ( GLfloat  innerRadius,
GLfloat  outerRadius,
GLint  sides,
GLint  rings 
)
inline

Draws a solid torus.

Parameters
innerRadiusequivalent to the width of the torus ring
outerRadiusradius from the center of the torus to the center of the ring
sidesresolution of steps to take around the band of the ring
ringsresolution of steps to take around the torus
Precondition
innerRadius must be greater than zero
outerRadius must be greater than zero
sides must be greater than two
rings must be greater than two
Note
Torus is oriented in the XY-plane with the origin at its center

◆ drawWireCone()

void CSCI441::drawWireCone ( GLfloat  base,
GLfloat  height,
GLint  stacks,
GLint  slices 
)
inline

Draws a wireframe cone.

Parameters
baseradius of the base of the cone
heightheight of the cone from the base to the tip
stacksresolution of the number of steps rotated around the central axis of the cone
slicesresolution of the number of steps to take along the height
Precondition
base must be greater than zero
height must be greater than zero
stacks must be greater than zero
slices must be greater than two
Note
Cone is oriented along the y-axis with the origin along the base of the cone

◆ drawWireCube()

void CSCI441::drawWireCube ( GLfloat  sideLength)
inline

Draws a wireframe cube.

Parameters
sideLengthlength of the edge of the cube
Precondition
sideLength must be greater than zero
Note
The origin is at the cube's center of mass. Cube is oriented with our XYZ axes

◆ drawWireCylinder()

void CSCI441::drawWireCylinder ( GLfloat  base,
GLfloat  top,
GLfloat  height,
GLint  stacks,
GLint  slices 
)
inline

Draws a wireframe open ended cylinder.

Parameters
baseradius of the base of the cylinder
topradius of the top of the cylinder
heightheight of the cylinder from the base to the top
stacksresolution of the number of steps rotated around the central axis of the cylinder
slicesresolution of the number of steps to take along the height
Precondition
either: (1) base is greater than zero and top is greater than or equal to zero or (2) base is greater than or equal to zero and top is greater than zero
height must be greater than zero
stacks must be greater than zero
slices must be greater than two
Note
Cylinder is oriented along the y-axis with the origin along the base

◆ drawWireDisk()

void CSCI441::drawWireDisk ( GLfloat  inner,
GLfloat  outer,
GLint  slices,
GLint  rings 
)
inline

Draws a wireframe disk.

Parameters
innerequivalent to the width of the disk
outerradius from the center of the disk to the center of the ring
slicesresolution of the number of steps rotated along the disk
ringsresolution of the number of steps to take along the disk width
Precondition
inner is greater than or equal to zero
outer is greater than zero
outer is greater than inner
slices is greater than two
rings is greater than zero
Note
Disk is drawn in the XY plane with the origin at its center

◆ drawWireDome()

void CSCI441::drawWireDome ( GLfloat  radius,
GLint  stacks,
GLint  slices 
)
inline

Draws a wireframe dome.

Parameters
radiusradius of the dome
stacksresolution of the number of steps to take along theta (rotate around Y-axis)
slicesresolution of the number of steps to take along phi (rotate around X- or Z-axis)
Precondition
radius must be greater than 0
stacks must be greater than 2
slices must be greater than 2
Note
Origin is at the center of the dome

◆ drawWireHalfSphere()

void CSCI441::drawWireHalfSphere ( GLfloat  radius,
GLint  stacks,
GLint  slices 
)
inline

Draws a wireframe half sphere with a bottom.

Parameters
radiusradius of the sphere
stacksresolution of the number of steps to take along theta (rotate around Y-axis)
slicesresolution of the number of steps to take along phi (rotate around X- or Z-axis)
Precondition
radius must be greater than 0
stacks must be greater than 2
slices must be greater than 2
Note
Origin is at the center of the sphere

◆ drawWirePartialDisk()

void CSCI441::drawWirePartialDisk ( GLfloat  inner,
GLfloat  outer,
GLint  slices,
GLint  rings,
GLfloat  start,
GLfloat  sweep 
)
inline

Draws part of a wireframe disk.

Parameters
innerequivalent to the width of the disk
outerradius from the center of the disk to the center of the ring
slicesresolution of the number of steps rotated along the disk
ringsresolution of the number of steps to take along the disk width
startangle in degrees to start the disk at
sweepdistance in degrees to rotate through
Precondition
inner is greater than or equal to zero
outer is greater than zero
outer is greater than inner
slices is greater than two
rings is greater than zero
start is between [0, 360]
sweep is between [0, 360]
Note
Disk is drawn in the XY plane with the origin at its center

◆ drawWireSphere()

void CSCI441::drawWireSphere ( GLfloat  radius,
GLint  stacks,
GLint  slices 
)
inline

Draws a wireframe sphere.

Parameters
radiusradius of the sphere
stacksresolution of the number of steps to take along theta (rotate around Y-axis)
slicesresolution of the number of steps to take along phi (rotate around X- or Z-axis)
Precondition
radius must be greater than 0
stacks must be greater than 2
slices must be greater than 2
Note
Origin is at the center of the sphere

◆ drawWireTeapot()

void CSCI441::drawWireTeapot ( GLfloat  unused = 1.0f)
inline

Draws a wireframe teapot.

Parameters
unusedpresent for historical compatability
Precondition
size must be greater than zero
Note
Oriented with spout and handle running along X-axis, cap and bottom along Y-axis. Origin is at the center of the teapot

◆ drawWireTorus()

void CSCI441::drawWireTorus ( GLfloat  innerRadius,
GLfloat  outerRadius,
GLint  sides,
GLint  rings 
)
inline

Draws a wireframe torus.

Parameters
innerRadiusequivalent to the width of the torus ring
outerRadiusradius from the center of the torus to the center of the ring
sidesresolution of steps to take around the band of the ring
ringsresolution of steps to take around the torus
Precondition
innerRadius must be greater than zero
outerRadius must be greater than zero
sides must be greater than two
rings must be greater than two
Note
Torus is oriented in the XY-plane with the origin at its center

◆ setVertexAttributeLocations()

void CSCI441::setVertexAttributeLocations ( GLint  positionLocation,
GLint  normalLocation = -1,
GLint  texCoordLocation = -1 
)
inline

Sets the attribute locations for vertex positions, normals, and texture coordinates.

Parameters
positionLocationlocation of the vertex position attribute
normalLocationlocation of the vertex normal attribute
texCoordLocationlocation of the vertex texture coordinate attribute
Note
Needs to be called after a shader program is being used and before drawing geometry