Assignment Two
"Penguin" by Finlayson
void drawHead( void )
{
int theta;
GLfloat r = 6.0; /* we use 6 as the default radius, and multiply it for smaller/larger */
/* the very top portion is like a cone... */
glBegin( GL_TRIANGLE_FAN );
glVertex3f( 0.0, 48.0, 0.0 ); /* top of the head */
for( theta=0; theta<=360; theta+=DELTA_THETA )
{
glVertex3f( r*cos(toRadian(theta)), 45.0, r*sin(toRadian(theta)) );
}
glEnd( );
/* the next portion is like a cylindar going down from that... */
glBegin( GL_QUAD_STRIP );
for( theta=0; theta<=360; theta+=DELTA_THETA )
{
glVertex3f( r*cos(toRadian(theta)), 45.0, r*sin(toRadian(theta)) );
glVertex3f( r*cos(toRadian(theta))*1.3, 38.0, r*sin(toRadian(theta))*1.3 );
}
glEnd( );
/* the next portion is like another cylindar, but with different slope... */
glBegin( GL_QUAD_STRIP );
for( theta=0; theta<=360; theta+=DELTA_THETA )
{
glVertex3f( r*cos(toRadian(theta))*1.3, 38.0, r*sin(toRadian(theta))*1.3 );
glVertex3f( r*cos(toRadian(theta))*1.3, 33.0, r*sin(toRadian(theta))*1.3 );
}
glEnd( );
/* yet another cylinder like thing */
glBegin( GL_QUAD_STRIP );
for( theta=0; theta<=360; theta+=DELTA_THETA )
{
glVertex3f( r*cos(toRadian(theta))*1.3, 33.0, r*sin(toRadian(theta))*1.3 );
glVertex3f( r*cos(toRadian(theta)), 26.0, r*sin(toRadian(theta)) );
}
glEnd( );
}
Assignment Three
"Rubics Cube" by Fulmer
////////////////NEW ROW
///BACK BOTTOM ROW LEFT BLOCK
a=startVertex[0];
b=startVertex[1];
c=startVertex[2];
xa=x+a;
xb=x+b;
xc=x+c;
glBegin (drawType);
//back side of cube
glColor3fv (green);
glVertex3f(xa, b, c);
glVertex3f(a, b, c);
glVertex3f(a, xb, c);
glVertex3f(xa, xb, c);
glEnd();
glBegin (drawType);
//front side of cube
glColor3fv(black);
glVertex3f(xa, b, xc);
glVertex3f(a, b, xc);
glVertex3f(a, xb, xc);
glVertex3f(xa, xb, xc);
glEnd();
glBegin (drawType);
//left side of cube
glColor3fv (white);
glVertex3f(a, b, c);
glVertex3f(a, b, xc);
glVertex3f(a, xb, xc);
glVertex3f(a, xb, c);
glEnd();
"A lot of data points" by Ferry