OpenGL Shapes Lab: Drawing and Projection Techniques, Essays (university) of Computer Graphics

OpenGL common function in 2d and 3d

Typology: Essays (university)

2020/2021

Uploaded on 03/13/2021

hani-ghanim
hani-ghanim 🇪🇬

3 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
DT228 Graphics & Image Processing
Lab 2: More OpenGL
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?
pf2

Partial preview of the text

Download OpenGL Shapes Lab: Drawing and Projection Techniques and more Essays (university) Computer Graphics in PDF only on Docsity!

DT228 Graphics & Image Processing

Lab 2: More OpenGL

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?