

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
OpenGL common function in 2d and 3d
Typology: Essays (university)
1 / 2
This page cannot be seen from the preview
Don't miss anything!


In this lab we see how to draw more shapes using OpenGL, play around with the projection parameters a little bit and experiment with line width.
Task 1: Begin a new C++ Win32 Console Application Project in Visual Studio .NET called Lab2OpenGLShapes. Set the root folder to a Graphics folder on your student storage.
Task 2: Modify the file Lab2OpenGLShapes.cpp so that it draws a selection of shapes.
Task 3: Before running your application put the files glut32.dll , glut32.lib and glut.h into your project’s root folder. These files are available on the course website.
Task 4: Build and run your application! It should look like this:
Task 5: Experiment with setting the current colour before drawing each vertex in the triangle. Can you get it to look like the following?
Task 6: Can you draw the following shape? Try to make it look as close to the shape below as possible – colours, lines etc. Experiment with glLineWidth , glPointSize and different drawing options such as GL_LINE_LOOP , GL_LINE_STRIP and GL_POINTS.
Task 7: Experiment with what happens when the parameters to the gluOrtho2D function in order to understand how it works. Can you get the window to display the following by only changing the parameters passed to gluOrtho2D?