Results 1 to 3 of 3

Thread: Basic questions from a newbie

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2001
    Posts
    1

    Basic questions from a newbie

    Hello,

    I'm new to OpenGL and there are a few things which I didn't really get when I read through my OpenGL book: the Viewport, Clipping areas or volumes and parallel projections.

    In the text it says that if you want to draw in a window you have to tell OpenGL which coordinate system you want to use and how it should be translated into screen coordinates.
    Furthermore it says that this can be done by specifying the Clipping area.
    In the next step the viewport maps the clipping area to physical screen coordinates.

    I wrote a program which draws a rectlange but nowhere I need to specify the clipping area of a window.
    I just have to set the window's heigth and width, and can start drawing without concerning about the minimum and maximum x, and y range ( I don't mention the z axis here, because I just want to draw 2d stuff first ).
    So my assumption is that the coordinates which I use to draw exactly match with the window.
    Even if I change the original size of the window, I can draw in every part of it.

    So, where do I need any translation then?
    Why and where do I have to specify the clipping area if it seems to me to match exactly with the current windows size (in pixels) ?

    By the way:
    What are orthographical projections?
    What do they do?
    When do I need them?


    I'm really frustrated...

    I would appreciate any help,

    Paladin

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Dec 2007
    Posts
    1,077

    Re: Basic questions from a newbie

    Well, didn't get your question... Anyway.

    You will always need a projection, to project a 3d vertex to a 2d pixel. So, if you call glPerspective glOrtho etc. these will set up the correct projection matrices (and store it on the GL_PROJECTION - matrix stack).
    A perspective projection is a projection with a perspective ( ), means, objects far away get drawn smaller, object near you bigger. It has a fov, it's something like a pyramid going out of your eyes, where the top is in your is somewhere behind your eyes.
    An orthographic projection lets object in every direction be of the same size. (3d modelers use that in the wireframe windows for example.)

  3. #3
    Guest

    Re: Basic questions from a newbie

    I think you need to go over your book again, only more slowly. OpenGL has some defaults specified which is probably why you haven't needed to set anything yet.

    Othographical projections are only useful if you are trying to draw something theoretical, like a blue print or a mathematical model, since there is no correction for persective being done. In the real world things look smaller as they get further away from the viewer. So when you draw things onto a 2D surface the same size object needs to get smaller as it moves away from the viewer into the screen.

    Try using the gluLookAt function to see how your model changes as you change your camera. First three parameters in the function

Similar Threads

  1. tow basic questions
    By zydgyy in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 01-17-2012, 06:42 AM
  2. Some basic questions
    By jide in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 05-09-2006, 11:06 AM
  3. Some basic questions
    By Polygon21 in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 08-30-2004, 07:55 AM
  4. Newbie Questions
    By solopido in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 08-23-2002, 05:15 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