Вы находитесь на странице: 1из 1

Royal University of Phnom Penh CG: Lab 5

Faculty of Engineering Lecture: Kor Sokchea

Lab 5: Modelling Transformation


In this lab, we continue from previous lab.
Bronze Challenge: Allow the user to translate the axis from starting point to ending
point when use presses letter t key in keyboard

Hint: glTranslatef(GLfloat x, GLfloat y, GLfloat z);

Silver Challenge: Allow the user to scale the axis and bar chart with the s key

Hint: glScalef(GLfloat x, GLfloat y, GLfloat z);

Golden Challenge: Allow the user to rotate the axis and bar chart from horizontal
to vertical using r key.

Hint: glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);

Hint: In order to use keyboard in OpenGL, you can create a callback function and
apply it to glutKeyboardFunc(keypress);

Example: void key(unsigned char key, int x, int y)

key: callback parameter is the generated ASCII character


x, y: callback parameters indicate the mouse location in window relative
coordinates when the key was pressed.

Deadline: 23:59, 02th, April 2017

Вам также может понравиться