Homework 3
Short Description:
Make the OpenGL program in chapter 1 of your book run.
This assignment is worth 10 points.
Goals
When you finish this homework, you should have
- Made sure that you can enter and compile OpenGL programs.
Formal Description
Enter the program starting on page 5 of the book. You will need to make the
following changes
- glutInitContextVersion(3,0);
You also need to create two files, triangles.vert and triangles.frag. These are programs that will run on the GPU. The program triangles.vert is listed on page 23, but needs the following change
- Don't include #version 430 core
- Don't include the layout line.
- In place of layout put attribute vec4 vPosition;
The program triangles.frag is listed on page 25, make the following changes
- Don't include #version 430 core
- Replace out vec4 fcolor with varying vec4 fColor;
- Replace the body of the function with gl_FragColor = vec4(0.0, 0.0, 1.0, 1.0);
To make life easy, we will be using Makefiles. You should save the following file in your directory and use it to compile.
Notes
This program must compile and run on the department's linux workstations.
Submission
Create a tar file containing the source code for the main program and both shaders, along with the Makefile required to build your program. This should be submitted to your instructor via email by the due date.