SUN YAT-SEN UNIVERSITY
Homework 7: Mesh Viewer
Computer Graphics
2017-01-01
1. Introduction
Congratulation! You have come to the last homework in this course. If you have finished all former homework by yourself, good job, and this one would be easy for you. Although you have come so far in learning Computer Graphics, modern Computer Graphic is much more than what you have learnt. If you are interested in Computer Graphics or making games or animations, many other knowledges/technologies you must learn by yourself. Good luck, and hope you get good grade in the course.
Warning: All codes and documents should be written and submitted individually, without copying existed answers (Neither from other student nor from the Internet). Plagiarism = Fail. Besides, there may be at least 30% penalty for late homework.
2. Tasks
2.1 Pre-requirement
-
Language: Only C/C++ is accepted in this homework.
-
Libraries: OpenGL and other additional libraries.
-
OS/IDE: Any OS/IDE can be used.
2.2 Mesh Viewer
You are required to implement a mesh viewer in this homework. You can refer to MeshLab Project for the program’s functionalities.
Your program should at least involve:
- Read in an OBJ file and display it as a mesh model in a window.
- At least 3 display mode: Flatlines, Wireframe, Flat.(Show as follow)
- Translation, Rotation, and Scaling of the model.
- Basic lighting.
- Texture and colors.
- 2 shading mode: Gouraud Shading and Phong Shading.
- A menu bar that contain the buttons of above functions.
Display mode:
Wireframe | Flat | Flatlines |
---|---|---|
![]() |
![]() |
![]() |
Example result:
Bonus:
- Read in any type of mesh model such as .obj, .x, .stl…
- Implement subdivision above the mesh model you import.
Hints:
- You can import your mesh model by 3rd party library. ASSIMP would be a good choice. Sure, you can also write your own file reader!
- There are many GUI libraries, we recommesnd you to use QT. But if you are skillful at MFC or other GUI library, feel free to use it.
- Be sure to submit all the library file along with you binary file.(i.e. *.dll file in windows.)
- If you are confused with the requirement, ask TAs for help.
3. Submitting Format
Please submit your homework to sysucg2017@163.com. You subject of the email should be as same as your attachment(aka. your .zip file)
Only a .zip file should be submitted. Under the .zip file, the content should look like this:
classTpye_studentID_Name_hw?_version?/
|— src/
|— doc/
|— bin/
- classType: R for required class(必修班); E for elective class(选修班).
- studentID: 1xxxxxxx
- Name: Your Chinese Name.
- hw?: Specific which homework you are submitting.
- version?: Specific if you modify your submitted homework, only the last version would be graded. Started with version0.
- src/: The folder holds your project, including source files.(Make sure you execute the clean command, we don’t need those temporary files)
- doc/: Only one PDF should be included.
- bin/: Executable program and a ReadMe.txt to tell us how to run your program.
For example, a student in required class want to submit homework2 for the second time, his .zip file should be:
R_16214382_杨耀兴_hw2_version1.zip
|—R_16214382_杨耀兴_hw2_version1/
|—src/ ——放整个工程
|—doc/ ——放report.pdf
|—bin/ ——放可执行文件和readme