0% found this document useful (0 votes)
6 views

CG2

Uploaded by

Hemanth Gowda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

CG2

Uploaded by

Hemanth Gowda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

CG Programs(IA-2)

1. Design an OpenGL program to display a sphere with keyboard operation.

#include <glut.h>

float rotationX = 0.0f;


float rotationY = 0.0f;
float scale = 1.0f;

void display() {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();

glBegin(GL_POINTS);
glColor3f(1.0, 0.0, 0.0);
glPointSize(5.0);
glVertex2i(400, 700);
glEnd();

glTranslatef(0.0f, 0.0f, -5.0f);


glRotatef(rotationX, 1.0f, 0.0f, 0.0f);
glRotatef(rotationY, 0.0f, 1.0f, 0.0f);
glScalef(scale, scale, scale);

glutSolidSphere(1.0, 30, 30);

glPointSize(10.0f);
glBegin(GL_POINTS);
glVertex3f(0.0f, 1.07f, 0.0f);
glVertex3f(1.07f, 0.0f, 0.0f);
glEnd();

glutSwapBuffers();
}

void keyboard(unsigned char key, int x, int y) {


switch (key) {
case 'w':
rotationX -= 5.0f;
break;
case 's':
rotationX += 5.0f;
break;
case 'a':
rotationY -= 5.0f;
break;
case 'd':
rotationY += 5.0f;
break;
case '+':
scale += 0.1f;
break;
case '-':
scale = (scale > 0.1f) ? scale - 0.1f : scale;
break;
}
glutPostRedisplay();
}

void initOpenGL() {
glEnable(GL_DEPTH_TEST);
glClearColor(0.2, 0.2, 0.2, 1.0);

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(45.0, 800.0 / 600.0, 1.0, 100.0);
glMatrixMode(GL_MODELVIEW);

glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);

GLfloat light_position[] = { 1.0, 1.0, 1.0, 0.0 };


GLfloat light_ambient[] = { 0.3, 0.3, 0.3, 1.0 };
GLfloat light_diffuse[] = { 1.0, 1.0, 1.0, 1.0 };
glLightfv(GL_LIGHT0, GL_POSITION, light_position);
glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient);
glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse);
}

int main(int argc, char** argv) {


glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize(800, 600);
glutCreateWindow("3D Sphere Interaction");

initOpenGL();

glutDisplayFunc(display);
glutKeyboardFunc(keyboard);

glutMainLoop();
return 0;
}

2. Develop a program to show the different solid quadric surfaces.

#include <glut.h>
#include <stdio.h>
void init(void) {
GLfloat light_ambient[] = { 1.0, 1.0, 1.0, 1.0 };
GLfloat light_diffuse[] = { 1.0, 1.0, 1.0, 1.0 };
GLfloat light_specular[] = { 1.0, 1.0, 1.0, 1.0 };
GLfloat light_position[] = { 1.0, 1.0, 1.0, 0.2 };
glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient);
glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse);
glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular);
glLightfv(GL_LIGHT0, GL_POSITION, light_position);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glEnable(GL_DEPTH_TEST);
}
void display(void) {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
glRotatef(20.0, 1.0, 0.0, 0.0);
//CONE
glPushMatrix();
glTranslatef(-0.7, 0.5, 0.0);
glRotatef(270.0, 1.0, 0.0, 0.0);
glutSolidCone(0.8, 2.1, 15, 15);
glPopMatrix();
//CUBE
glPushMatrix();
glTranslatef(-0.75, -0.5, 0.0);
glRotatef(85, 1.0, 0.0, 0.0);
glRotatef(-20, 0.0, 0.0, 1.0);
glutSolidCube(1.7);
glPopMatrix();
//SPHERE
glPushMatrix();
glTranslatef(0.5, 0.0, 3.0);
glutSolidSphere(1.0, 30, 30);
glPopMatrix();
//CYLINDER
GLUquadricObj* qobj;
qobj = gluNewQuadric();
glPushMatrix();
gluQuadricDrawStyle(qobj, GLU_FILL);
gluQuadricNormals(qobj, GLU_SMOOTH);
glTranslatef(0.7, 0.0, -4.5);
glRotatef(90, 1.0, 0.0, 0.0);
glRotatef(30, 0.0, 0.0, 1.0);
gluCylinder(qobj, 0.85, 0.85, 3.0, 6, 6);
glPopMatrix();
glFlush();
}
void reshape(int w, int h) {
glViewport(0, 0, (GLsizei)w, (GLsizei)h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
if (w <= h)
glOrtho(-2.5, 2.5, -2.5 * (GLfloat)h / (GLfloat)w, 2.5 * (GLfloat)h /
(GLfloat)w, -10.0, 10.0);
else
glOrtho(-2.5 * (GLfloat)w / (GLfloat)h, 2.5 * (GLfloat)w / (GLfloat)h,
-2.5, 2.5, -10.0, 10.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
int main(int argc, char** argv) {
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize(500, 500);
glutCreateWindow("Solid objects");
init();
glutReshapeFunc(reshape);
glutDisplayFunc(display);

glutMainLoop();
return 0;
}

3. Draw a simple shaded scene consisting of a teapot on a table. Define suitably


the position and properties of the light source along with the properties of the
surfaces of the solid object used in the scene.

#include<glut.h>

void obj(double tx, double ty, double tz, double sx, double sy, double sz)
{
glRotated(50, 0, 1, 0);
glRotated(10, -1, 0, 0);
glRotated(11.7, 0, 0, -1);
glTranslated(tx, ty, tz);
glScaled(sx, sy, sz);
glutSolidCube(1);
glLoadIdentity();
}
void display()
{
glViewport(0, 0, 700, 700);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
obj(0, 0, 0.5, 1, 1, 0.04); // 3 walls
obj(0, -0.5, 0, 1, 0.04, 1);
obj(-0.5, 0, 0, 0.04, 1, 1);
obj(0, -0.3, 0, 0.02, 0.2, 0.02); //4 table legs
obj(0, -0.3, -0.4, 0.02, 0.2, 0.02);
obj(0.4, -0.3, 0, 0.02, 0.2, 0.02);
obj(0.4, -0.3, -0.4, 0.02, 0.2, 0.02);
obj(0.2, -0.18, -0.2, 0.6, 0.02, 0.6); //table surface

glRotated(50, 0, 1, 0);
glRotated(10, -1, 0, 0);
glRotated(11.7, 0, 0, -1);
glTranslated(0.3, -0.1, -0.3);
glutSolidTeapot(0.15);
glFlush();
glLoadIdentity();
}
void main(int argc, char** argv)
{
float ambient[] = { 1,1,1,1 };
float light_pos[] = { 27,80,2,3 };
glutInitWindowSize(700, 700);
glutCreateWindow("Teapot");
glutDisplayFunc(display);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glMaterialfv(GL_FRONT, GL_AMBIENT, ambient);
glLightfv(GL_LIGHT0, GL_POSITION, light_pos);
glEnable(GL_DEPTH_TEST);
glutMainLoop();
}

4. Clip lines using the Cohen-Sutherland algorithm.

#include <stdio.h>
#include <glut.h>
double xmin = 50, ymin = 50, xmax = 100, ymax = 100;
double xvmin = 200, yvmin = 200, xvmax = 300, yvmax = 300;
const int RIGHT = 8;
const int LEFT = 2;
const int TOP = 4;
const int BOTTOM = 1;
int ComputeOutCode(double x, double y)
{
int code = 0; if (y > ymax)
code |= TOP;
//above the clip window
else if (y < ymin)
code |= BOTTOM;
//below the clip window
if (x > xmax)
code |= RIGHT;
//to the right of clip window
else if (x < xmin)
code |= LEFT;
//to the left of clip window
return code;
}
void CohenSutherland(double x0, double y0, double x1, double y1)
{
int outcode0, outcode1, outcodeOut;
int accept = 0, done = 0;
outcode0 = ComputeOutCode(x0, y0);
outcode1 = ComputeOutCode(x1, y1);
do {
if (!(outcode0 | outcode1))
{
accept = 1; done = 1;
}
else if (outcode0 & outcode1) done = 1;
else {
double x, y;
outcodeOut = outcode0 ? outcode0 : outcode1;
if (outcodeOut & TOP)
{
x = x0 + (x1 - x0) * (ymax - y0) / (y1 - y0);
y = ymax;
}
else if (outcodeOut & BOTTOM)
{
x = x0 + (x1 - x0) * (ymin - y0) / (y1 - y0);
y = ymin;
}
else if (outcodeOut & RIGHT)
{
y = y0 + (y1 - y0) * (xmax - x0) / (x1 - x0);
x = xmax;
}
else
{
y = y0 + (y1 - y0) * (xmin - x0) / (x1 - x0);
x = xmin;
}
if (outcodeOut == outcode0)
{
x0 = x; y0 = y;
outcode0 = ComputeOutCode(x0, y0);
}
else {
x1 = x; y1 = y;
outcode1 = ComputeOutCode(x1, y1);
}
}
} while (!done);
if (accept)
{
double sx = (xvmax - xvmin) / (xmax - xmin);
double sy = (yvmax - yvmin) / (ymax - ymin);
double vx0 = xvmin + (x0 - xmin) * sx;
double vy0 = yvmin + (y0 - ymin) * sy;
double vx1 = xvmin + (x1 - xmin) * sx;
double vy1 = yvmin + (y1 - ymin) * sy;
glColor3f(1.0, 1.0, 1.0);
glBegin(GL_LINE_LOOP);
glVertex2f(xvmin, yvmin);
glVertex2f(xvmax, yvmin);
glVertex2f(xvmax, yvmax);
glVertex2f(xvmin, yvmax);
glEnd(); glColor3f(1.0, 1.0, 1.0);
glBegin(GL_LINES);
glVertex2d(vx0, vy0);
glVertex2d(vx1, vy1);
glEnd();
}
}
void display()
{
double x0 = 60, y0 = 20, x1 = 80, y1 = 120;
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0, 1.0, 1.0);
glBegin(GL_LINES); glVertex2d(x0, y0);
glVertex2d(x1, y1); glEnd();
glColor3f(1.0, 1.0, 1.0);
glBegin(GL_LINE_LOOP);
glVertex2f(xmin, ymin);
glVertex2f(xmax, ymin);
glVertex2f(xmax, ymax);
glVertex2f(xmin, ymax);
glEnd();
CohenSutherland(x0, y0, x1, y1);
glFlush();
}
void myinit()
{
glClearColor(0.0, 0.0, 0.0, 1.0);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0.0, 500.0, 0.0, 500.0);
glMatrixMode(GL_MODELVIEW);
}
void main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize(500, 500);
glutInitWindowPosition(0, 0);
glutCreateWindow("Cohen Suderland Line Clipping Algorithm");
myinit();
glutDisplayFunc(display);
glutMainLoop();
}

5. Draw a colored cube and spin it using OpenGL transformation matrices.

#include<stdlib.h>
#include<glut.h>

GLfloat vertices[] = { -1.0,-1.0,-1.0,1.0,-1.0,-1.0,1.0,


1.0,-1.0,-1.0,1.0,-1.0,-1.0,-1.0,1.0,
1.0,-1.0,1.0,1.0,1.0,1.0,-1.0,1.0,1.0 };

GLfloat colors[] = { 0.0,0.0,0.0,1.0,0.0,0.0,1.0,1.0,0.0,


0.0,1.0,0.0,0.0,0.0,1.0,1.0,0.0,
1.0,1.0,1.0,1.0,0.0,1.0,1.0 };

GLubyte cubeIndices[] = { 0,3,2,1,2,3,7,6,0,4,7,3,1,2,6,5,4,5,6,7,0,1,5,4 };


static GLfloat theta[] = { 0.0,0.0,0.0 };
static GLint axis = 2;

void display(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glRotatef(theta[0], 1.0, 0.0, 0.0);
glRotatef(theta[1], 0.0, 1.0, 0.0);
glRotatef(theta[2], 0.0, 0.0, 1.0);
glDrawElements(GL_QUADS, 24, GL_UNSIGNED_BYTE, cubeIndices);
glFlush();
glutSwapBuffers();
}

void spinCube()
{
theta[axis] += 0.05;
if (theta[axis] > 360.0) theta[axis] -= 360.0;
glutPostRedisplay();
}

void mouse(int btn, int state, int x, int y)


{
if (btn == GLUT_LEFT_BUTTON && state == GLUT_DOWN)
axis = 0;
if (btn == GLUT_MIDDLE_BUTTON && state == GLUT_DOWN)
axis = 1;
if (btn == GLUT_RIGHT_BUTTON && state == GLUT_DOWN)
axis = 2;
}
void myReshape(int w, int h)
{
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
if (w <= h)
glOrtho(-2.0, 2.0, -2.0 * (GLfloat)h / (GLfloat)w, 2.0 * (GLfloat)h /
(GLfloat)w, -10.0, 10.0);
else
glOrtho(-2.0 * (GLfloat)w / (GLfloat)h, 2.0 * (GLfloat)w / (GLfloat)h,
-2.0, 2.0, -10.0, 10.0);
glMatrixMode(GL_MODELVIEW);
}

void main(int argc, char** argv)


{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize(500, 500);
glutCreateWindow("Spin a color cube");
glutReshapeFunc(myReshape);
glutDisplayFunc(display);
glutIdleFunc(spinCube);
glutMouseFunc(mouse);
glEnable(GL_DEPTH_TEST);
glEnableClientState(GL_COLOR_ARRAY);
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3, GL_FLOAT, 0, vertices);
glColorPointer(3, GL_FLOAT, 0, colors);
glColor3f(1.0, 1.0, 1.0);
glutMainLoop();
}

6. Design a program to display cubes without using glLoadIdentity.

#include <glut.h>

GLfloat vertices[] = {
-1.0f, -1.0f, -1.0f,
1.0f, -1.0f, -1.0f,
1.0f, 1.0f, -1.0f,
-1.0f, 1.0f, -1.0f,
-1.0f, -1.0f, 1.0f,
1.0f, -1.0f, 1.0f,
1.0f, 1.0f, 1.0f,
-1.0f, 1.0f, 1.0f
};
GLubyte cubeIndices[] = {
0, 3, 2, 1,
2, 3, 7, 6,
0, 4, 7, 3,
1, 2, 6, 5,
4, 5, 6, 7,
0, 1, 5, 4
};

GLfloat rotationX = 30.0f;


GLfloat rotationY = 30.0f;

void display(void) {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

glTranslatef(0.0f, 0.0f, -6.0f);


glRotatef(rotationX, 1.0f, 0.0f, 0.0f);
glRotatef(rotationY, 0.0f, 1.0f, 0.0f);

glColor3f(0.0f, 0.5f, 0.8f);


glVertexPointer(3, GL_FLOAT, 0, vertices);
glEnableClientState(GL_VERTEX_ARRAY);
glDrawElements(GL_QUADS, 24, GL_UNSIGNED_BYTE, cubeIndices);

glColor3f(0.0f, 0.0f, 0.0f);


glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
glDrawElements(GL_QUADS, 24, GL_UNSIGNED_BYTE, cubeIndices);

glutSwapBuffers();
}

void myReshape(int w, int h) {


glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);

if (w <= h)
glOrtho(-2, 2, -2 * (GLfloat)h / (GLfloat)w, 2 * (GLfloat)h / (GLfloat)w,
-10, 10);
else
glOrtho(-2 * (GLfloat)w / (GLfloat)h, 2 * (GLfloat)w / (GLfloat)h, -2, 2,
-10, 10);

glMatrixMode(GL_MODELVIEW);
}

int main(int argc, char** argv) {


glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize(500, 500);
glutCreateWindow("Cube without LoadIdentity func");

glEnable(GL_DEPTH_TEST);

glutReshapeFunc(myReshape);
glutDisplayFunc(display);

glutMainLoop();
return 0;
}

7. Draw a colored cube and allow the user to move the camera suitably to experiment
with perspective viewing.

#include <glut.h>

float v[] = { -1,-1,-1, -1,1,-1, 1,1,-1, 1,-1,-1, -1,-1,1, -1,1,1,


1,1,1, 1,-1,1 };
float c[] = { 0,0,0, 1,0,0, 1,1,0, 0,1,0, 0,0,1, 1,0,1, 1,1,1, 0,1,1, };
GLubyte list[] = { 0,1,2,3, 2,3,7,6, 4,5,6,7, 4,5,1,0, 5,6,2,1, 0,3,7,4 };
int gx = 0, gy = 0, gz = 1;
static GLfloat theta[] = { 0.0,0.0,0.0 };
static GLint axis = 2;
static GLdouble viewer[] = { 0.0, 0.0, 5.0 };
void display(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
gluLookAt(viewer[0], viewer[1], viewer[2], 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
glRotatef(theta[0], 1.0, 0.0, 0.0);
glRotatef(theta[1], 0.0, 1.0, 0.0);
glRotatef(theta[2], 0.0, 0.0, 1.0);
glDrawElements(GL_QUADS, 24, GL_UNSIGNED_BYTE, list);
glFlush();
}
void mouse(int btn, int state, int x, int y)
{
if (btn == GLUT_LEFT_BUTTON && state == GLUT_DOWN) axis = 0;
if (btn == GLUT_MIDDLE_BUTTON && state == GLUT_DOWN) axis = 1;
if (btn == GLUT_RIGHT_BUTTON && state == GLUT_DOWN) axis = 2;
theta[axis] += 2.0;
if (theta[axis] > 360.0) theta[axis] -= 360.0;
display();
}
void keys(unsigned char key, int x, int y)
{
if (key == 'x') viewer[0] -= 1.0;
if (key == 'X') viewer[0] += 1.0;
if (key == 'y') viewer[1] -= 1.0;
if (key == 'Y') viewer[1] += 1.0;
if (key == 'z') viewer[2] -= 1.0;
if (key == 'Z') viewer[2] += 1.0;
display();
}
void main()
{
glutInitWindowSize(700, 700);
glutCreateWindow("Colorcube Viewer");
glMatrixMode(GL_PROJECTION);
glFrustum(-2.0, 2.0, -2.0, 2.0, 2.0, 20.0);
glMatrixMode(GL_MODELVIEW);
glutDisplayFunc(display);
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
glVertexPointer(3, GL_FLOAT, 0, v);
glColorPointer(3, GL_FLOAT, 0, c);
glutMouseFunc(mouse);
glutKeyboardFunc(keys);
glEnable(GL_DEPTH_TEST);
glutMainLoop();
}

8. Design a program to drag a square with the movement of a mouse.

#include <glut.h>

float squareX = 0.0f;


float squareY = 0.0f;
bool dragging = false;
int lastX, lastY;

void display() {
glClear(GL_COLOR_BUFFER_BIT);

glLoadIdentity();
glTranslatef(squareX, squareY, 0.0f);

glBegin(GL_QUADS);
glColor3f(0.0f, 0.0f, 1.0f);
glVertex2f(-0.1f, -0.1f);
glVertex2f(0.1f, -0.1f);
glVertex2f(0.1f, 0.1f);
glVertex2f(-0.1f, 0.1f);
glEnd();

glutSwapBuffers();
}

void mouseMotion(int x, int y) {


if (dragging) {
int windowHeight = glutGet(GLUT_WINDOW_HEIGHT);
float scaleX = 2.0f / glutGet(GLUT_WINDOW_WIDTH);
float scaleY = 2.0f / windowHeight;

squareX += (x - lastX) * scaleX;


squareY -= (y - lastY) * scaleY;

lastX = x;
lastY = y;

glutPostRedisplay();
}
}

void mouseButton(int button, int state, int x, int y) {


if (button == GLUT_LEFT_BUTTON) {
if (state == GLUT_DOWN) {
dragging = true;
lastX = x;
lastY = y;
}
else if (state == GLUT_UP) {
dragging = false;
}
}
}

void initOpenGL() {
glClearColor(1.0, 1.0, 1.0, 1.0);
gluOrtho2D(-1.0f, 1.0f, -1.0f, 1.0f);
}

int main(int argc, char** argv) {


glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);
glutInitWindowSize(500, 500);
glutCreateWindow("Dragding Square with Mouse");

initOpenGL();

glutDisplayFunc(display);
glutMotionFunc(mouseMotion);
glutMouseFunc(mouseButton);

glutMainLoop();
return 0;
}
9. Implement a program to display the wireframe model of a sphere.

#include <glut.h>
GLsizei winWidth = 500, winHeight = 500;
void init(void)
{
glClearColor(1.0, 1.0, 1.0, 0.0);
}
void wireQuadSurfs(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(0.0, 0.0, 1.0);
gluLookAt(2.0, 2.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0);

glPushMatrix();
glTranslatef(1.0, 1.0, 0.0);
glutWireSphere(1.0, 8, 6);
glPopMatrix();
glFlush();

}
void winReshapeFcn(GLint newWidth, GLint newHeight)
{
glViewport(0, 0, newWidth, newHeight);
glMatrixMode(GL_PROJECTION);
glOrtho(-2.0, 2.0, -2.0, 2.0, 0.0, 5.0);
glMatrixMode(GL_MODELVIEW);
glClear(GL_COLOR_BUFFER_BIT);
}
void main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowPosition(100, 100);
glutInitWindowSize(winWidth, winHeight);
glutCreateWindow("Wire-Frame Quadric Surfaces");
init();
glutDisplayFunc(wireQuadSurfs);
glutReshapeFunc(winReshapeFcn);
glutMainLoop();
}

You might also like