SUN YAT-SEN UNIVERSITY
Homework 6: Bezier curve
Computer Graphics
2017-04-24
1. Introduction
In the class you have learn the definition of Bezier curve and B-spline curve. In this homework you are required to design a Bezier curve drawer. In order to do so, you need to deal with keyboard and mouse input.
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: Only OpenGL and freeGLUT/GLFW can be used.
-
OS/IDE: Any OS/IDE can be used.
2.2 Bezier Curve
You need to implement a 2D Cubic Bezier drawer, the requirements are as follow:
- The user of the program can draw 4 control points in the screen by using his mouse, your program need to the corresponding cubic Bezier curve for those 4 points.
- The user can modify the controlling points’ positions after they first draw the curve. Your program should regenerate the corresponding curve when the controlling points changed.
- Bonus1: Adjust your program such that the user can choose his favorite color for the curve.
- Bonus2: How about letting user to draw a curve in 3D space? To do so you need to figure out how to map the 2D mouse input into 3D coordinate system. For more detail, you can reference 3D modeling softwares such as Blender, Maya and 3dMax…
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