Ehsan_Liverpool

04-18-2011, 11:53 AM

Hi!

ive been working on this project for sometime now, and i just cant get my hexswirl function to work :( please help. its supposed to look like this: http://www.slidefinder.net/C/Computer_Graphics_using_OpenGL_3rd/15456597/p2 (the picture in slide 22 or 24)

I need this for a project which is due next week :(

by the way this is what ive come up with so far:

void Polygon11::draw(float n, float s, float a)

{

float r1;

double inc = 5.0/100;

double angleInc = 2*3.14159265/6.0;

double aaa;

r1 = radius;

for (int j = 0; j < 50; j++)

{

aaa = j* 3.14159265/180.0;

glBegin(GL_LINE_LOOP);

for (int i = 0; i < 6 ; i++)

{

a += angleInc;

glVertex2f(r1*s*cos((i*aaa)+10),r1*s*sin((i*aaa)+1 0)); glEnd();

r1 += inc;

}

}

ive been working on this project for sometime now, and i just cant get my hexswirl function to work :( please help. its supposed to look like this: http://www.slidefinder.net/C/Computer_Graphics_using_OpenGL_3rd/15456597/p2 (the picture in slide 22 or 24)

I need this for a project which is due next week :(

by the way this is what ive come up with so far:

void Polygon11::draw(float n, float s, float a)

{

float r1;

double inc = 5.0/100;

double angleInc = 2*3.14159265/6.0;

double aaa;

r1 = radius;

for (int j = 0; j < 50; j++)

{

aaa = j* 3.14159265/180.0;

glBegin(GL_LINE_LOOP);

for (int i = 0; i < 6 ; i++)

{

a += angleInc;

glVertex2f(r1*s*cos((i*aaa)+10),r1*s*sin((i*aaa)+1 0)); glEnd();

r1 += inc;

}

}