View Full Version : Viewport
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
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
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
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
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.