PDA

View Full Version : How can i create 3-D sight on another 3-D sight ?



MeadowDreamer
10-21-2002, 03:14 AM
Hello,

i have created a 3-D sight with OpenGL and now i want create another on this OpenGL - Window another small OpenGL - Window in the right corner of the other one. How can I do this ?

Thanks for your help

nexusone
10-21-2002, 03:49 AM
Are you using GLUT?
With GLUT you can create subwindows inside the main window.


Originally posted by MeadowDreamer:
Hello,

i have created a 3-D sight with OpenGL and now i want create another on this OpenGL - Window another small OpenGL - Window in the right corner of the other one. How can I do this ?

Thanks for your help

MeadowDreamer
10-21-2002, 04:27 AM
Originally posted by nexusone:
Are you using GLUT?
With GLUT you can create subwindows inside the main window.



No, i don't. I use only the commands with gl* and glu*. My OpenGL - Graphic ist in a window which is create with QT.

nexusone
10-21-2002, 09:44 AM
I have not used it but glscissor command also I think will do it.
I don't have a example handy, but do a search on the command.



Originally posted by MeadowDreamer:
No, i don't. I use only the commands with gl* and glu*. My OpenGL - Graphic ist in a window which is create with QT.

10-21-2002, 04:00 PM
You can change where you are drawing in with glViewport. You will have to update your projection matrix, though.

-- Thomas

MeadowDreamer
10-21-2002, 10:39 PM
How can i prevent with glViewport that the background of my second OpenGL - Window repaint the background of my first OpenGL - Window. The background of my first OpenGL - Window is black and the background of my second OpenGL - Window is white. Or in other words: "The second window should lay over the first one and they should be independ from each other".

[This message has been edited by MeadowDreamer (edited 10-22-2002).]

Gavin
10-22-2002, 12:52 AM
What makes the window backgrtounds different colours, you drawing on them or clearing ther colour buffer?

MeadowDreamer
10-22-2002, 09:05 PM
i clear the colour buffer if i want draw the second window. But i suppose that it wrong and that i should find another order.

MeadowDreamer
10-22-2002, 10:38 PM
I want create two windows. A big one and a small one. First of all i create the big OpenGL - Window with glViewport, glFrustum and so on and after this i want create a small OpenGL - Window in the right corner which ist indepent from the first. I want create it with glViewport, glFrustum and so too. But for example glFrustum will defined for both and i don't know and the moment how i can prevent it.
Have someone proposals ?

Thanks for help

10-24-2002, 10:28 AM
You may pass your code into another Device context. Or at least you can use another projection matrix. I think that is enough. However I mainly advise you to use OOP for your scene. This will make your code more clear and it will help you to control more than 2 scene like things. You create an abstract data layer for your scene and another class that renders the scene to your primary device context. Late on you may use pointers to switch between back and forth to the windows. http://www.opengl.org/discussion_boards/ubb/smile.gif

veal
10-25-2002, 02:22 AM
hi, i just read in another topic a link to someting similar... multiviews (not inside each other, but besides). maybe it helps you: http://www.xmission.com/~nate/sgi.html

Gavin
10-25-2002, 03:16 AM
Well using the viewport will work, but obviously you will need to draw both windows each time, which you don't want to do. So maybe render to texture and then texture map as you want to 2 windows. so you only need to re render each window as the contents change.