PDA

View Full Version : Viewport



09-14-2000, 10:03 PM
I have to make a 3D cube program that has two viewports. I have scoured this site, Read my computer graphics book and it is not helping. All I have managed to do thus far is draw a window with a light blue background. Can someone pllleeeaaasseee help me out?? Information on what sites have opengl tutorials would also be veerrry useful to me.

Thanks

Eric
09-14-2000, 10:38 PM
I don't really understand what you mean : do you want to windows that display the same scene (a cube) ? Do you want one split window (which is the same) ?

Which operating system are u using ?
Which development tool are u using ?

Can you give a bit more explanations ?

Regards.

Eric

09-15-2000, 11:46 AM
Originally posted by Eric:
I don't really understand what you mean : do you want to windows that display the same scene (a cube) ? Do you want one split window (which is the same) ?

Which operating system are u using ?
Windows 95

Which development tool are u using ?
DevStudio

Can you give a bit more explanations ?

I would like to display 2 different cubes (a wire frame, and cube with colored sides) in the same window

Regards.

Eric

Sorry about the short explanation http://www.opengl.org/discussion_boards/ubb/smile.gif
Tonia

09-15-2000, 04:09 PM
I'm new to opengl so i don't know if how
I explain this is entirely correct...

but anyway, I'll assume you're using glut
and want to split a window into, as you say,
two viewports so as to reder to different
locations within the window...

A viewport just maps the scene into a place
in your window. Set it with...
glViewport(originX, originY, width, height)

so for example to draw into different viewports, or segemnts of the window, alter the viewport with - what else - glViewport()
and then draw whatever it is you want to draw
...wireframe cubes and triangles perhaps http://www.opengl.org/discussion_boards/ubb/wink.gif

maybe it would look something like this...
which divides your screen into to segements
of size 256x256:

void glutDisplay()
{
.
.
.

//Set first viewport
glViewport(0,0, 256,256);

//Things drawn here will be placed on the
//left side of the screen

//Set the second viewport
glViewport(256,0, 256,256);

//Things drawn here will be placed on the
//right side of the screen

.
.
.
}

Hope this helps...well at least it hasn't added to your confusion...right http://www.opengl.org/discussion_boards/ubb/smile.gif