Results 1 to 9 of 9

Thread: glscale and glOrtho

  1. #1
    Senior Member Regular Contributor
    Join Date
    Mar 2003
    Location
    Slovakia
    Posts
    108

    glscale and glOrtho

    my question: what does the glScale an glOrtho do - some better explanation than in MSDN Library

  2. #2
    Junior Member Newbie
    Join Date
    Aug 2001
    Location
    minneapolis,MN,USA
    Posts
    13

    Re: glscale and glOrtho

    hi,

    this site will help U:
    http://www.eecs.tulane.edu/www/graph...dex_alpha.html

    --Ravi

  3. #3
    Guest

    Re: glscale and glOrtho

    Ortho specifies the coordinates of your drawing area. They can be whatever you specify, and they will be stretched or shrunk to fit your viewport.

    glScale actually multiplies whatever coordinates you draw by the appropriate x,y or z value. So, if you drew to coord (10,10) after a glscale call of (0.5,2), your point would get drawn at (5,20)

  4. #4
    Senior Member Regular Contributor
    Join Date
    Mar 2003
    Location
    Slovakia
    Posts
    108

    Re: glscale and glOrtho

    the page did not help very much (it is the same as MSDN) but thanks anyway.
    about LoadIdentity - is that mean that i get the original matrix(1,1,1) or that with glOrtho ?
    and when I use glTranslate am I moving the zero point(0,0,0)(matrix (?)) to new location or just the drawing point ?

  5. #5
    Senior Member Regular Contributor
    Join Date
    Dec 1969
    Location
    Munich,Germany
    Posts
    227
    yes

  6. #6
    Junior Member Newbie
    Join Date
    Jun 2001
    Location
    Newcastle-Upon-Tyne, Tyne and Wear, England
    Posts
    8

    Re: glscale and glOrtho

    It actually makes more sense if I answer your questions in reverse order...

    glTranslate moves the coordinate system. Say you start your scene with -

    glTranslate3f(0.0f, 0.0f, -0.2f);

    This would move the coordinate system slightly away from you. (You actually need to do this before drawing anything or you will not be able to see it!) What I mean by moving the coordinate system is that the origin (0, 0, 0) is moved. In this case it is moved away from you slightly down the Z axis. Anything drawn from now on uses this new origin.

    glLoadIdentity() actually resets the coordinate system back to its original location. Pretty simple really. Do this before translating the scene away from you or you might get unexpected results!

    I think this explanation is correct. I am only a beginner myself but opengl seems to have clicked with me. If I explained anything wrong here then please could someone let me know because that means I do not understand even the fundamentals

  7. #7
    Senior Member Regular Contributor
    Join Date
    Mar 2003
    Location
    Slovakia
    Posts
    108

    Re: glscale and glOrtho

    thanks ,now I get some thinks that I didn't before.
    My last 2 question (for now ): PushMatrix - what does this do ? it preserves the coordinatinon system in its current location or ... ?

    gluSphere (or glutWire(Solid)Sphere ) : how to shrink or enlarge the sphere and in what measurement units is radius counted ?

    thanks

  8. #8
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: glscale and glOrtho

    glPushMatrix saves the current matrix so you can go back to it in a later stage. You use glPopMatrix to get it back.

    The argument you pass to glu(Solid|Wire)Sphere is measured in units. Actuallt, OpengL doesn't deal with units (units as in meter, yard, inch) at all. One unit can be whatever you like. If you want to draw a smaller/bigger sphere, just decrease/increase it's raduis.

  9. #9
    Senior Member Regular Contributor
    Join Date
    Mar 2003
    Location
    Slovakia
    Posts
    108

    Re: glscale and glOrtho

    Thanks - that with radius was my wrong translation

Similar Threads

  1. Where to put glScale?
    By Aliii in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 05-28-2012, 04:31 PM
  2. glScale
    By mr_coolio in forum OpenGL: Basic Coding
    Replies: 7
    Last Post: 03-27-2003, 08:30 AM
  3. glScale and Normals
    By mr_coolio in forum OpenGL: Basic Coding
    Replies: 10
    Last Post: 02-27-2003, 02:22 AM
  4. about glscale() -_-!
    By iux in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 02-05-2003, 04:22 AM
  5. glScale and reflections
    By MButchers in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 09-21-2001, 03:11 PM

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