PDA

View Full Version : resizing my function



MIKE1
04-09-2010, 02:08 PM
When this function is called how do I change the size to make larger.

static void torus(int numc, int numt)
{
float lx=0.0f,ly=-1.0f,lz=-1.0f;
int i, j, k;
double s, t, x, y, z, twopi;

twopi = 2 * PI_;
for (i = 0; i < numc/3; i++) {
glBegin(GL_QUAD_STRIP);
glPushMatrix();
for (j = 0; j <= numt; j++) {
for (k = 1; k >= 0; k--) {
s = (i + k) % numc + 0.5;
t = j % numt;

x = (1+.1*cos(s*twopi/numc))*cos(t*twopi/numt);
y = (1+.1*cos(s*twopi/numc))*sin(t*twopi/numt);
z = .1 * sin(s * twopi / numc/2);
//changeSize(0,15);
//glutReshapeFunc(changeSize);
glVertex3f(x, y +move_turus, z);


}
}
glPopMatrix ();
glEnd();
}
}

MIKE1
04-09-2010, 02:10 PM
When this function is called how do I change the size to make larger or smaller

strattonbrazil
04-09-2010, 04:01 PM
What are you doing there with glutReshapeFunc? That's typically specified once and only once in a program and takes a function that handles resize enters like window drags or resizes.

Is there a reason glScale won't work for you?

MIKE1
04-09-2010, 04:15 PM
I have commented out the glutReshapeFunc because it did not work.

Y-tension
04-10-2010, 05:38 AM
Is there a reason glScale won't work for you?

<-repeat