GuitarFan

06-22-2013, 01:13 PM

glBegin(GL_TRIANGLE_STRIP);

for(i; i <= degree; i++)

{

float

sunX=-200/2*cos(i*M_PI/180),

sunZ=200/2*sin(i*M_PI/180);

glVertex3f(0, 0, 0);

glVertex3f(sunX, 0, sunZ);

}

glEnd();

This code is work. But...

for(i; i <= degree; i++)

{

float

sunX=-200/2*cos(i*M_PI/180),

sunZ=200/2*sin(i*M_PI/180);

glBegin(GL_TRIANGLE_STRIP);

glVertex3f(0, 0, 0);

glVertex3f(sunX, 0, sunZ);

glEnd();

}

But this doesn't work. Wtf? Where is logic?

I need to insert another code into for cycle for text out:

glPushAttrib(GL_LIST_BIT);

glListBase(1000);

glCallLists(strlen(text), GL_UNSIGNED_BYTE, text);

glPopAttrib();

but i can't to insert it, because beetwen glBegin(GL_TRIANGLE_STRIP) and glEnd() it does not work. And i can't write glBegin(GL_TRIANGLE_STRIP), glEnd() inside for cycle, because it does not work there.

for(i; i <= degree; i++)

{

float

sunX=-200/2*cos(i*M_PI/180),

sunZ=200/2*sin(i*M_PI/180);

glVertex3f(0, 0, 0);

glVertex3f(sunX, 0, sunZ);

}

glEnd();

This code is work. But...

for(i; i <= degree; i++)

{

float

sunX=-200/2*cos(i*M_PI/180),

sunZ=200/2*sin(i*M_PI/180);

glBegin(GL_TRIANGLE_STRIP);

glVertex3f(0, 0, 0);

glVertex3f(sunX, 0, sunZ);

glEnd();

}

But this doesn't work. Wtf? Where is logic?

I need to insert another code into for cycle for text out:

glPushAttrib(GL_LIST_BIT);

glListBase(1000);

glCallLists(strlen(text), GL_UNSIGNED_BYTE, text);

glPopAttrib();

but i can't to insert it, because beetwen glBegin(GL_TRIANGLE_STRIP) and glEnd() it does not work. And i can't write glBegin(GL_TRIANGLE_STRIP), glEnd() inside for cycle, because it does not work there.