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 6 of 6

Thread: trying cool stuff with mutliple viewports??

  1. #1
    Junior Member Regular Contributor
    Join Date
    Mar 2000
    Location
    Aurora, Illinois, USA
    Posts
    217

    trying cool stuff with mutliple viewports??

    I tried this on the beginner board... and received no replies... I hope on this board I get better luck.

    well, ever played Starfox64 multiplayer with less than 4 players? if so, you've noticed the "camera" quadrant(s). That's what I am trying to accomplish (in a very basic way).
    my window size: 480x240

    so, my first guess was... setting the Viewport in my InitGL() by:

    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();

    glViewport(0,0,240,240);
    glOrtho(-2.0f,2.0f,-2.0f,2.0f,-1.0f,1.0f);

    glViewport(240,0,240,240);
    glOrtho(-2.0f,2.0f,-2.0f,2.0f,-1.0f,1.0f);

    glMatrixMode(GL_MODELVIEW);


    So... in my DrawScene() i drew a circle with r=1 at the origin... I expected to see two circles, but instead I only got the right viewport... perhaps I was mistakened but I thought you would specify the viewport, and then assign the clipping plane to it... and you could do this over and over... but, am I mistakened? if so, how else could I do what I want to do?
    Navreet Gill [img]/forum/images/%%GRAEMLIN_URL%%/smile.gif[/img]

  2. #2
    Junior Member Regular Contributor
    Join Date
    Mar 2000
    Location
    Aurora, Illinois, USA
    Posts
    217

    Re: trying cool stuff with mutliple viewports??

    Can someone PLEEEEEEEEEEEEEEEEEASE HELP ME?!?

    I have no idea how to get around this...
    Navreet Gill [img]/forum/images/%%GRAEMLIN_URL%%/smile.gif[/img]

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Jun 2000
    Location
    Shreveport, LA, USA
    Posts
    1,757

    Re: trying cool stuff with mutliple viewports??

    You can only draw to one viewport at a time.
    Set the first viewport, draw the scene for it, set the second viewport, draw the scene for it. And so on.

  4. #4
    Junior Member Regular Contributor
    Join Date
    Mar 2000
    Location
    Aurora, Illinois, USA
    Posts
    217

    Re: trying cool stuff with mutliple viewports??

    I guess that works... thanks a lot though =)

    [This message has been edited by ngill (edited 07-09-2000).]
    Navreet Gill [img]/forum/images/%%GRAEMLIN_URL%%/smile.gif[/img]

  5. #5
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,527

    Re: trying cool stuff with mutliple viewports??

    "and then assign the clipping plane to it... "

    Be careful, though the glViewport sets the matrix for the final viewport transformation and thereby the viewing frustum planes, it does not set 2D clipping like you need it for glClear.
    You probably won't have the problem because you clear the whole window each frame, but if you have to clear a single viewport you'll have to use glScissor() and enable scissor test.

  6. #6
    Junior Member Regular Contributor
    Join Date
    Mar 2000
    Location
    Aurora, Illinois, USA
    Posts
    217

    Re: trying cool stuff with mutliple viewports??

    Cool , I haven't gotten to the Scissors (sp?) stuff yet... but I think I can read ~300 pages in a week . I have nothing to do... I love the summer...
    Navreet Gill [img]/forum/images/%%GRAEMLIN_URL%%/smile.gif[/img]

Posting Permissions

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