GLProgramming.com

home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-


New Paste :: Recent Pastes:: Add Line Numbers


A Paste by Anonymous
void drawStars(void)
{
    int i, j;
    float x, y, z;

    glPushMatrix();
    glColor3f(1.0, 1.0, 1.0);
    glBegin(GL_POINTS);
    for (i = 0; i < 360; i += 20)
    {
        for (j = 0; j < 90; j += 20)
        {
            x = 40 * sin(i) * cos(j);
            y = 40 * sin(j);
            z = 40 * cos(i) * cos(j);
            printf("Drawing star at (%f, %f, %f)\n", x, y ,z);
            glVertex3f(x, y, z);
        }
    }
    glEnd();
    glPopMatrix();
}