Main Page   Compound List   File List   Compound Members  

RoundedCube Class Reference

Models a cube with rounded edges. More...

#include <RoundedCube.h>

List of all members.

Public Types

enum  axis { Xaxis, Yaxis, Zaxis }
 The x-, y-, and z-axis.


Public Methods

 RoundedCube (float s_length=0.8, float r_width=0.1, int r_steps=2)
 Constructs a cube with rounded edges. More...

void render ()
 Draws the cube. More...

void rotate (axis a, bool direction)
 Rotates the cube 90 degrees. More...


Public Attributes

bool draw_normals
 Should normals be drawn? This should only be set to true, if you're debugging.


Detailed Description

Models a cube with rounded edges.

The cube will be made up of six squares with rounded edges in-between. The sides will be red, green, blue, orange, yellow, and white just as the original Rubik's Cube. They will only reflect little of the specular light that shines on them, but they will reflect all the diffuse light.

The rounded edges will be black, but will have more intense highlights than the sides. This gives a nice effect when the cube rotates in front of a light.


Constructor & Destructor Documentation

RoundedCube::RoundedCube float    s_length = 0.8,
float    r_width = 0.1,
int    r_steps = 2
 

Constructs a cube with rounded edges.

Parameters:
s_length  the length of the sides. This is only the length of the squares. To get the total width/height/depth of the cube, you'll have to add two times r_width as well.
r_width  the width of the roundings.
r_steps  the number of steps used to do the rounded edges. The edges will consist of r_steps rectangles - the larger the number, the finer the edge.


Member Function Documentation

void RoundedCube::render  
 

Draws the cube.

The cube will be drawn centered around (0, 0).

void RoundedCube::rotate axis    a,
bool    direction
 

Rotates the cube 90 degrees.

The cube will rotate by changing the color of the sides.

Parameters:
a  the axis to rotate around. The axis are local to the cube.
direction  if direction is true, then the cube will be rotated clockwise, otherwise it will be rotated counter-clockwise.


The documentation for this class was generated from the following files:
Generated on Mon Jan 14 11:23:22 2002 for rubik by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001