$25
I. Introduction
This first programming assignment will introduce you to the OpenGL graphics programming interface and programmable pipeline. In this programming assignment, you need to create a 3D scene with user interaction (see the good examples in Fig. 1). The objective of this assignment is to apply your understanding of the computer graphics basic concepts; get familiar with the OpenGL programming library and give you an introduction to the programmable pipeline.
Fig. 1 Good examples of 3D scene by previous students.
Your goal is to design a 3D scene with user interaction. Specifically, in your scene, there must have a ground, 2D objects (e.g. arrow) and 3D objects (e.g. cube, tetrahedron) (see Fig. 2 as an example), and you should be able to apply arbitrary transformations including translation, rotation, and scaling to them. The user should be able to use the keyboard (and/or the mouse) to translate, rotate, and scale the object. The object color, window size, window title and window background color are all up to you. In order to make your scene more realistic, you should use the perspective projection instead of orthographic projection. You are recommended to draw objects with indexing. Your 3D scene shall not be limited by the demo program.
Fig. 2 Basic requirements of assignment 1.
II. Implementation Details
In this assignment package, we have provided you with two shader programs (i.e., VertexShaderCode.glsl & FragmentShaderCode.glsl) and a template program (i.e., main.cpp) which include the necessary functions you are going to use and callback functions in the GLUT interface toolkit. Use this template as the basis for your implementation. You need to design your own function to process the keyboard events, and you should also submit a file like readme.txt to specify the keyboard (and/or mouse) events you design in your program. Otherwise, the mark for related items will be deducted.
All programs should meet reasonable programming standards: header comment, in-line comments, good modularity, clear printout, and efficiency.
Basic Requirements:
1. OpenGL code should be written using programmable pipeline instead of fixed pipeline with OpenGL 2.0+;
2. Draw at least 2 geometric primitives (one must be 3D object) in the 3D scene and place them above a ground;
3. Ensure at least one object is drawn with indexing;
4. Create at least three kinds of keyboard and/or mouse events, such as rotation, translation and scaling;
5. Use perspective projection to draw the scene;
6. Enable depth test to realize occlusion;
Additional self-design requirements:
You are free to add objects, move them, organize them, and whatever you wish to make your scene interesting