Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: glScalef() problem

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2012
    Location
    Please select ...
    Posts
    10

    glScalef() problem

    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();
    }

  2. #2
    Senior Member OpenGL Pro BionicBytes's Avatar
    Join Date
    Mar 2009
    Location
    UK, London
    Posts
    1,161

    Re: glScalef() problem

    yes...and?
    What is your problem?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •