0% found this document useful (0 votes)
38 views1 page

Lab 5: Modelling Transformation: Bronze Challenge

This lab document outlines three challenges - bronze, silver, and gold - for modeling transformations in OpenGL. The bronze challenge involves translating objects along an axis using the 't' key. The silver challenge scales objects using the 's' key. The gold challenge rotates objects from horizontal to vertical using the 'r' key. Hints are provided on the relevant OpenGL transformation functions and setting a keyboard callback in GLUT. The deadline for completing these challenges is 23:59 on April 2nd, 2017.

Uploaded by

Sen Sokha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views1 page

Lab 5: Modelling Transformation: Bronze Challenge

This lab document outlines three challenges - bronze, silver, and gold - for modeling transformations in OpenGL. The bronze challenge involves translating objects along an axis using the 't' key. The silver challenge scales objects using the 's' key. The gold challenge rotates objects from horizontal to vertical using the 'r' key. Hints are provided on the relevant OpenGL transformation functions and setting a keyboard callback in GLUT. The deadline for completing these challenges is 23:59 on April 2nd, 2017.

Uploaded by

Sen Sokha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 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

You might also like