PDA

View Full Version : glScalef() problem



herba
04-08-2012, 11:30 PM
i wanna write a code to produced by scaling a rectangle repeatedly in the x and y direction about its centre. the scaling parameter were the same each times .

void shape()
{
glColor3f(1,0,0);
glBegin(GL_LINE_LOOP);
glVertex2f(200,40);
glVertex2f(200,-40);
glVertex2f(-200,-40);
glVertex2f(-200,40);
glEnd();
}

void scaleRect( )
{
for(int i = 0; i < 12; i++)
{
glPushMatrix();
float sx =1.0+10.0*i/11.0;
float sy =1-(11.0/12.0)*(i/11.0);
float sz =0;
glScalef(sx,sy,sz);
shape();
glColor3f(1,0,0);

glPopMatrix();
}

BionicBytes
04-09-2012, 04:48 AM
yes...and?
What is your problem?