1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
void drawRotatingObject( const Point & center, int rotation)
{
struct PT
{
int x;
int y;
} points[] =
{
{0, 12}, {8, 20}, {16, 14},
{10, 12}, {20, 0}, {0, -20},
{-18, -10}, {-20, -2}, {-20, 14},
{-10, 20}, {0, 12}
};
glBegin(GL_LINE_STRIP);
//The outside now has a blue greenish color
glColor3f(0.0 /* red % */, 3.2 /* green % */, 2.0 /* blue % */);
for (int i = 0; i < sizeof(points)/sizeof(PT); i++)
{
Point pt(center.getX() + points[i].x,
center.getY() + points[i].y);
rotate(pt, center, rotation);
glVertex2f(pt.getX(), pt.getY());
}
glColor3f(1.0, 1.0, 1.0);
glEnd();
}
|