• Advertisement

Archived

This topic is now archived and is closed to further replies.

Opengl frames

This topic is 5711 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Can someone please explain (or give a hint or suggestion, anything) how to create "sub windows" like those used in Nate Robins'' GL Tutors (http://www.xmission.com/%7Enate/tutors.html) without using glut? I feel like I''ve run into a brick wall with my project. Thanks, diddly

Share this post


Link to post
Share on other sites
Advertisement
Ok, that brings up another question I have been meaning to ask. What exactly (ok, not exactly, just generally) does the glViewport() command do? I have tried playing around with it, but I can''t seem to understand what it does. I read the documentation on msdn, but I am unclear on a few (read: many) things. When it refers to "affine coordinates" and "normalized device coordinates," what is it talking about?

Thanks for the help,
diddly

Share this post


Link to post
Share on other sites
glViewport controls the window coordinates, where in the window will the GL scene be drawn.

Imagine you have a window origin (0,0) dimensions (w,h).
glViewport(0,0,w,h) makes you render to the whole window
glViewport(0,0,w/2,h/2) makes you render to the upper-left quarter.


Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]

Share this post


Link to post
Share on other sites
Oh right, so is that how the picture-in-picture in Counter-strike is done?

Henrym

[edited by - henrym on June 2, 2002 5:06:54 PM]

Share this post


Link to post
Share on other sites
How are the coordinates numbered? Is (0, 0) the upper left or bottom left corner?

diddly

Share this post


Link to post
Share on other sites
quote:
Original post by diddly-yo
How are the coordinates numbered? Is (0, 0) the upper left or bottom left corner?

diddly



glViewport


bottom left, but checkout the MSDN for further information on the function, as well as all OpenGL functions....

To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.

Share this post


Link to post
Share on other sites
Yep. Just set the viewport to the top half of the screen, render for player 1, set vieport to bottom half, render for player 2.

Be sure you set the perspective correctly. Instead of the windowheight, use windowheight/2.

Sander Maréchal

[Lone Wolves Production][Articles][E-mail]

Share this post


Link to post
Share on other sites
yeah, i''ll have to try it out. I always thought it would be really cool. I was thinking left and right though, not top and bottom, but either way it''s basically the same. Or, i guess you could make it configurable which way the split goes. I guess it''s a totally different thing, rendering to two different monitors at the same time?? Like, if the video card has dual monitor support. I imagine that would be card specific code? Does anyone know?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by diddly-yo
How are the coordinates numbered? Is (0, 0) the upper left or bottom left corner?

diddly


(0,0) is the bottom left, just like all opengl commands...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by henrym
Oh right, so is that how the picture-in-picture in Counter-strike is done?

Henrym

<SPAN CLASS=editedby>[edited by - henrym on June 2, 2002 5:06:54 PM]</SPAN>


Probably...I dont know any other ways in which to render to only a part of the screen in a box like that. Also the box that scrolled up the screen that had the letters LOTR in the winning LOTR demo probably used glViewport too...

Share this post


Link to post
Share on other sites

  • Advertisement