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

Windmill: Glutkeyboardfunc (Void (Func) (Unsigned Char Key, Int X, Int Y) )

The document provides instructions for a computer graphics lab assignment to create an interactive 2D windmill simulation. Students are asked to (1) draw a windmill shape that can rotate clockwise or counterclockwise when keys L or R are pressed, (2) notify the user of the key controls through on-screen text or terminal output, (3) explain the meaning and value of variables x and y used in the keyboard callback function, and (4) terminate the program if the Q key is pressed. The goal is to simulate the rotation of a windmill based on user key presses using computer graphics.

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)
36 views1 page

Windmill: Glutkeyboardfunc (Void (Func) (Unsigned Char Key, Int X, Int Y) )

The document provides instructions for a computer graphics lab assignment to create an interactive 2D windmill simulation. Students are asked to (1) draw a windmill shape that can rotate clockwise or counterclockwise when keys L or R are pressed, (2) notify the user of the key controls through on-screen text or terminal output, (3) explain the meaning and value of variables x and y used in the keyboard callback function, and (4) terminate the program if the Q key is pressed. The goal is to simulate the rotation of a windmill based on user key presses using computer graphics.

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 9

Faculty of Engineering Lecture: Kor Sokchea

WindMill

(a) Draw 2D Windmill shape that can rotate in the screen plane by a certain positive or
negative angle in case the keys L or R are pressed, respectively. To do this, register a
keyboard callback with glutKeyboardFunc(void *(func)(unsigned char key, int x, int y))
(b) Tell the user by writing on the terminal (stdout, stderr) or into your graphics window
which key has to be pressed and what the effect is
(c) Answer the question: What is the meaning and the value of the variables x and y.
(d) If the key Q is pressed your program terminates.

Figure 1. Wind Mill

Deadline: 23:59, 4th, June 2017

You might also like