Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: looking for glScalef examples

  1. #1
    Senior Member Regular Contributor
    Join Date
    Mar 2003
    Location
    Chicago, IL US
    Posts
    101

    looking for glScalef examples

    Multiple sources of diff types would be very appreciated. Am applying to 2D case.

    Thanks a lot.

  2. #2
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    Kristianstad,Skåne,Sweden
    Posts
    1,595

    Re: looking for glScalef examples

    glScalef( 1, 2, 1); // for example...

    There is not much more you can do with it...

    Mikael

  3. #3
    Senior Member Regular Contributor
    Join Date
    Mar 2003
    Location
    Chicago, IL US
    Posts
    101

    Re: looking for glScalef examples

    Thanks for the reply.

    I guess I am looking more for some Web sites that would show the before and after. Do you know of any? Right now, I am getting a black screen when I try to add a line like you mentioned (except I have 0 in last arg). I comment out and my drawing returns. I am trying to expand it.

    Thanks.

  4. #4
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,753

    Re: looking for glScalef examples

    You don't want 0 for the last parameter. Use 1 for no scaling in that dimension.
    Deiussum
    Software Engineer and OpenGL enthusiast

  5. #5
    Junior Member Newbie
    Join Date
    Sep 2003
    Posts
    3

    Re: looking for glScalef examples

    glScale just multiplies the following X,Y and Z coordinates by the amount specified in the glScale command.

    Thats one of the simplest commands in OpenGL, why dont you just RTFM first?

  6. #6
    Senior Member Regular Contributor
    Join Date
    Mar 2003
    Location
    Chicago, IL US
    Posts
    101

    Re: looking for glScalef examples

    I'll continue to post on here since I still can't expand even with the last arg as 1 and hope that DOH! goes away

    Given that the following is within a display routine, what am I doing incorrectly?

    glClear(GL_COLOR_BUFFER_BIT);

    glBegin(GL_LINE_LOOP);
    glColor3f(1.0, 1.0, 1.0);
    glScalef(13.0, 13.0, 1.0);
    for (i=0; i<count; i++)
    {
    glVertex2f(c_array[i].lat, c_array[i].lon);
    }
    glEnd();

    glutSwapBuffers();

  7. #7
    Guest

    Re: looking for glScalef examples

    Try putting this after glClearColor:

    glPushMatrix(GL_MODELVIEW);
    glLoadIdentity();

    I hope this helps.

  8. #8
    Senior Member Regular Contributor
    Join Date
    Mar 2003
    Location
    Chicago, IL US
    Posts
    101

    Re: looking for glScalef examples

    Unfortunately, that's not really an option. I am already provided with a main function containing:

    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    gluOrtho2D(LEFT_EDGE, RIGHT_EDGE,
    BOTTOM_EDGE, TOP_EDGE);

    prior to the call to the display routine and need to maintain this "format"

    Thanks, though.

  9. #9
    Senior Member Regular Contributor
    Join Date
    Jun 2003
    Posts
    177

    Re: looking for glScalef examples

    Read what DOH! posted. It doesn't get any simpler than that.

  10. #10
    Senior Member Regular Contributor
    Join Date
    Mar 2003
    Location
    Chicago, IL US
    Posts
    101

    Re: looking for glScalef examples

    Well, maybe I don't understand what DOH! is saying - I just took at as an insult.

Page 1 of 2 12 LastLast

Similar Threads

  1. glScalef and glRotatef
    By SilviaLollipop in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 07-04-2013, 09:18 AM
  2. glScalef() problem
    By herba in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 04-09-2012, 05:48 AM
  3. glScalef()
    By mark-w in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 08-12-2005, 12:00 PM
  4. does glScalef...
    By grimoire in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 06-29-2004, 12:24 AM
  5. regarding glScalef()
    By karteek in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 03-28-2003, 05:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean