Hi,
I am trying to display four different viewport versions of this hexswirl image simultaneously. However, after compiling I can only see the fourth viewport in the lower left corner. I know that the hexswirl function calls the glClear each time and tried to comment out and got some crazy looking image. In reading the other posts on multiple viewports I have come upon glScissors but don’t really know how to use it. If someone could explain how to display all my viewports at the same time I would greatly appreciate it.
Here is the hexswirl code but since I can’t have parenthesis I have deleted them…
void hexswirl
{
double angle; //the angle of rotation
double angleInc = 2*3.14159265/6.0; //the angle increment
double inc = 5.0/100; //the radius increment
double radius = 5.0/100.0; //the radius to be used
//clear the background
glClear GL_COLOR_BUFFER_BIT;
//draw the hexagon swirl
for int j = 0; j <= 50; j++
{
//the angle of rotation depends on which hexagon is
//being drawn.
angle = j* 3.14159265/180.0;
//draw one hexagon
glBegin GL_LINE_STRIP;
for int k=0; k <= 6; k++
{
angle += angleInc;
glVertex2d
radius * cosangle radius *sinangle
}
glEnd;
//determine the radius of the next hexagon
radius += inc;
}
//swap buffers for a smooth change from one
//frame to another
glutSwapBuffers;
glFlush;
}