Results 1 to 4 of 4

Thread: Getting viewport boudries

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2009
    Posts
    3

    Getting viewport boudries

    I am trying to draw an object at the top of my view port. To get the view port dimensions I do the following:

    GLuint viewport[4];
    glGetIntegerv( GL_VIEWPORT, viewport );

    After this call I expect the (y + height) to be the top of my view port but when I try to draw the object just below that it's out of my view.

    What am I doing wrong?

    Thanks

  2. #2
    Senior Member Regular Contributor
    Join Date
    Jun 2009
    Location
    FL , USA
    Posts
    192

    Re: Getting viewport boudries

    I try to draw the object just below
    Does below mean the top edge of your view port ??

    it's out of my view
    Where is your camera centered? At the front or behind your object???

    Where is your camera pointing to ???

    Refer to gluLookAt() parameters.

    If you are sure you are drawing at a correct place inside the viewport quad, then other reason can be that your far plane is in front of the object's center.

    In summary, just cross check your camera parameters with that of the object.

  3. #3
    Junior Member Newbie
    Join Date
    Jul 2009
    Posts
    3

    Re: Getting viewport boudries

    Yes.. I'm trying to draw to the top edge of the view port. Also if I set my vertical location to 0 then the object is drawn to the bottom of the view, which is expected, so I know the camera is positioned properly.

  4. #4
    Senior Member Regular Contributor
    Join Date
    Jun 2009
    Location
    FL , USA
    Posts
    192

    Re: Getting viewport boudries

    ok. => your camera is facing your object.
    and that your object is in the view frustum.

    Can I look at your camera settings and the view port?

Similar Threads

  1. FBO and viewport
    By Swoop in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 07-17-2013, 12:34 PM
  2. 4 viewport
    By cwc36 in forum OpenGL: Basic Coding
    Replies: 11
    Last Post: 09-25-2002, 05:34 PM
  3. Replies: 2
    Last Post: 05-27-2002, 02:59 AM
  4. Getting the viewport
    By SurGL in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 04-18-2001, 04:20 AM
  5. Viewport or multiple viewport in a window!
    By Boubou in forum OpenGL: Basic Coding
    Replies: 9
    Last Post: 11-30-2000, 05:45 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