PDA

View Full Version : Mutiple viewport question



godhand
04-06-2004, 01:37 AM
Hi, I wish to display a image in three different viewport in one window, but the two image appeared to be distorted compared to the original one. How can I fix it? thanks in advance.

Bob
04-06-2004, 02:15 AM
You can fix it by making sure you render the image in a way it doesn't get distorted.

Without knowing what you do, how you do it, what you get, and what you want to get, we can't help you. You need to provide alot more information. Just saying something is wrong doesn't help at all.

godhand
04-06-2004, 03:32 AM
Here is the display code:


void display(void)
{


glViewport(0, 0, g_w, g_h);
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(0.0,0.0,0.0);
glLoadIdentity();



/*1st clock at left*/
glViewport(0, 0, g_w/2, g_h);


draw_clock();



glColor3f(0.0,0.0,0.0);


glLoadIdentity();

/*2nd clock at top right corner*/
glViewport(g_w/2,0,g_w/2,g_h/2);

draw_clock();

glColor3f(0.0,0.0,0.0);
glLoadIdentity();

/*3rd port */
glViewport(g_w/2,g_h/2,g_w/2,g_h/2);
draw_clock();

glFlush();

}

Bob
04-06-2004, 04:18 AM
Now I know how you do it, but I still don't know what you get, and what you want to get.

You can't just say something is broken and post some code and expect us to help without any information about the problem. You have to describe the problem, like what you get, what is wrong with it, and what you actually want to get. How is the image distorted? What do you do when rendering the clock?