SlideShare a Scribd company logo
1 of 22
1
Computer Graphics
Chapter 2
Input Devices
RM [2]-2
Input Devices
 Logical Input Devices
Categorized based on functional
characteristics.
Each device transmits a particular kind of
data.
The different types of data are called input
primitives.
 Physical Input Devices
Categorized based on the physical machine.
RM [2]-3
Logical Input Devices
 Locator Devices
Input Primitive: Coordinate position (x,y)
Examples: Mouse, Keyboard (Cursor-
Position Keys), Tablet(Digitizer), Trackballs,
Lightpens.
Applications: Interactive drawing and editing,
Graph digitizing.
RM [2]-4
Digitizer
RM [2]-5
Joystick and Trackball
RM [2]-6
Logical Input Devices
 String Devices
Input Primitive: A string of characters
Example: Keyboard
Applications: Text input
RM [2]-7
Logical Input Devices
 Valuator
Input primitive: Scalar values (typically
between 0 and 1).
Examples: Control Dials, Sensing devices,
Joysticks
Applications: Input of graphics parameters,
Graphics representation of analog values,
Process simulation, Games.
RM [2]-8
Logical Input Devices
 Choice
Input primitive: A selection from a list of
options.
Examples: Mouse, Keyboard (Function
Keys), Touch Panel etc
Applications: Interactive menu selection,
Program control.
RM [2]-9
Logical Input Devices
 Pick
Input primitive: Selection of a part of the
screen.
Examples: Mouse, Cursor Keys, Tablet.
Applications: Interactive editing and
positioning.
RM [2]-10
Physical Input Devices
 Keyboard (input functions: String, Choice,
Locator).
 Mouse (input functions: Locator, Pick,
Choice).
 Joystick (input functions: Locator, Valuator).
 Knob (Valuator).
 Tablet (Locator, Pick).
RM [2]-11
3D Interaction Devices (Recent
additions)
These devices are used in advanced rendering methods and virtual reality
systems for providing information about three dimensional positions and
motion.Few examples are
1. DATA GLOVES
2. SPACE BALLS
3. IMAGING SENSORS
These devices are used in advanced rendering
methods and virtual reality systems for providing
information about three dimensional positions and
motion.Few examples are
1. DATA GLOVES
2 SPACE BALLS
RM [2]-12
Space Ball, Data Glove
RM [2]-13
Event Driven Programming
Event
Call-back
Functions
• Mouse clicked.
• Mouse dragged.
• A key is pressed.
• The window is resized.
• The window is moved.
• Register.
• Define.
Event Queue
RM [2]-14
Mouse Interaction
 Mouse Event
Event that occurs when the mouse button is
pressed or released.
 Mouse Motion Event
Event that occurs when the mouse is moved
while one of the buttons is pressed.
RM [2]-15
Mouse Event
 Contains the following information:
Button: The mouse button that is pressed –
left, middle, right.
State: The state of the button – up, down.
Position: The position of the mouse when
the event occurs (x, y).
RM [2]-16
Mouse Event (OpenGL)
Registering with Mouse Event: glutMouseFunc(myMouse);
Call-back function:
void myMouse(int button, int state, int x, int y)
Values for button: GLUT_LEFT_BUTTON, GLUT_MIDDLE_BUTTON
GLUT_RIGHT_BUTTON
Values for state: GLUT_UP, GLUT_DOWN
x, y: Screen coordinates of mouse position (origin at top-left corner).
RM [2]-17
Mouse Motion Event
 Contains the following information:
Position: The current position of the mouse
as the mouse is being dragged holding one
of the buttons pressed. The events are
continuously generated as the mouse button
is pressed and dragged.
RM [2]-18
Mouse Motion Event (OpenGL)
Registering with Mouse Motion Event:
glutMotionFunc(myMovedMouse);
Call-back function: void myMovedMouse(int x, int y)
x, y: Screen coordinates of mouse position (origin at top-left corner).
RM [2]-19
Keyboard Event
 Contains the following information:
key: The ASCII value of the key pressed.
Position: The current position of the mouse
when the key is pressed.
RM [2]-20
Keyboard Event (OpenGL)
Registering with Keyboard Event:
glutKeyboardFunc(myKeyboard);
Call-back function:
void myKeyboard(unsigned int key, int x, int y)
Values of key: ASCII value for normal keys
GLUT_KEY_LEFT, GLUT_KEY_RIGHT..(Arrow keys)
x, y: Screen coordinates of mouse position (origin at top-left corner).
RM [2]-21
Window Events
 The Window Redraw Event occurs
whenever the window needs to be redrawn.
This happens when the window is first
opened and when the window is exposed by
moving another window off of it.
 The Window Reshape Event is generated
when the window is resized with the mouse.
RM [2]-22
Window Events (OpenGL)
Registering with Window Redraw Event:
glutDisplayFunc(myDisplay);
Registering with Window Reshape Event:
glutReshapeFunc(myReshape);

More Related Content

What's hot

Input and output devices
Input and output devicesInput and output devices
Input and output devicesALOK GUPTA
 
Welcome to the presentation of input & output
Welcome to the presentation of input &  outputWelcome to the presentation of input &  output
Welcome to the presentation of input & outputajaya024
 
Input and output devices
Input and output devicesInput and output devices
Input and output devicesDanyal Ahmad
 

What's hot (6)

Input Output
Input OutputInput Output
Input Output
 
Input and output devices
Input and output devicesInput and output devices
Input and output devices
 
Act4 Humility
Act4 HumilityAct4 Humility
Act4 Humility
 
Welcome to the presentation of input & output
Welcome to the presentation of input &  outputWelcome to the presentation of input &  output
Welcome to the presentation of input & output
 
Input and output devices
Input and output devicesInput and output devices
Input and output devices
 
Cit 1101 lec 004
Cit 1101 lec 004Cit 1101 lec 004
Cit 1101 lec 004
 

Viewers also liked

Input devices in computer graphics
Input devices in computer graphicsInput devices in computer graphics
Input devices in computer graphicsAnu Garg
 
Chapter 3 Output Primitives
Chapter 3 Output PrimitivesChapter 3 Output Primitives
Chapter 3 Output PrimitivesPrathimaBaliga
 
Computer Graphics Introduction
Computer Graphics IntroductionComputer Graphics Introduction
Computer Graphics IntroductionGhaffar Khan
 
Attributes of Output Primitives
Attributes of Output PrimitivesAttributes of Output Primitives
Attributes of Output PrimitivesRenita Santhmayora
 
Output primitives in Computer Graphics
Output primitives in Computer GraphicsOutput primitives in Computer Graphics
Output primitives in Computer GraphicsKamal Acharya
 

Viewers also liked (7)

Input devices in computer graphics
Input devices in computer graphicsInput devices in computer graphics
Input devices in computer graphics
 
Input Devices
Input Devices Input Devices
Input Devices
 
Chapter 3 Output Primitives
Chapter 3 Output PrimitivesChapter 3 Output Primitives
Chapter 3 Output Primitives
 
Input devices
Input devicesInput devices
Input devices
 
Computer Graphics Introduction
Computer Graphics IntroductionComputer Graphics Introduction
Computer Graphics Introduction
 
Attributes of Output Primitives
Attributes of Output PrimitivesAttributes of Output Primitives
Attributes of Output Primitives
 
Output primitives in Computer Graphics
Output primitives in Computer GraphicsOutput primitives in Computer Graphics
Output primitives in Computer Graphics
 

Similar to grahics

Computer Parts
Computer PartsComputer Parts
Computer PartsSimar Jeet
 
Assignment on Input and output devices
Assignment on Input and output devicesAssignment on Input and output devices
Assignment on Input and output devicesMahmudur Rahman Shojib
 
Input output devices
Input output devicesInput output devices
Input output devicesVijay Kumar
 
Introduction of Computers & C++ Programming
Introduction of Computers & C++ Programming Introduction of Computers & C++ Programming
Introduction of Computers & C++ Programming Mujeeb UR Rahman
 
Input and output devices.pdf
Input and output devices.pdfInput and output devices.pdf
Input and output devices.pdfAyeshaIftikhar67
 
Chapter 03 game input
Chapter 03 game inputChapter 03 game input
Chapter 03 game inputboybuon205
 
Presentation(Input,output,stoarage)
Presentation(Input,output,stoarage)Presentation(Input,output,stoarage)
Presentation(Input,output,stoarage)Maribel subteniente
 
Input devices
Input devicesInput devices
Input devicesFRK NIAZI
 
Hint 1 2D array of type Button, all buttons hidden except for one.pdf
Hint 1 2D array of type Button, all buttons hidden except for one.pdfHint 1 2D array of type Button, all buttons hidden except for one.pdf
Hint 1 2D array of type Button, all buttons hidden except for one.pdfFootageetoffe16
 
Various input devices showing their features
Various input devices showing their featuresVarious input devices showing their features
Various input devices showing their featuresLavan1997
 
Computer fundamental 2 Some information about computer. its input device and ...
Computer fundamental 2 Some information about computer. its input device and ...Computer fundamental 2 Some information about computer. its input device and ...
Computer fundamental 2 Some information about computer. its input device and ...HamaQarani
 

Similar to grahics (20)

Input devices.ppt
Input devices.pptInput devices.ppt
Input devices.ppt
 
I/O Devices
I/O DevicesI/O Devices
I/O Devices
 
Computer Parts
Computer PartsComputer Parts
Computer Parts
 
Assignment on Input and output devices
Assignment on Input and output devicesAssignment on Input and output devices
Assignment on Input and output devices
 
Input output devices
Input output devicesInput output devices
Input output devices
 
ITC_lec_4.ppt
ITC_lec_4.pptITC_lec_4.ppt
ITC_lec_4.ppt
 
Input device pp.pptx
Input device pp.pptxInput device pp.pptx
Input device pp.pptx
 
Introduction of Computers & C++ Programming
Introduction of Computers & C++ Programming Introduction of Computers & C++ Programming
Introduction of Computers & C++ Programming
 
Input and output devices.pdf
Input and output devices.pdfInput and output devices.pdf
Input and output devices.pdf
 
Input devices
Input devicesInput devices
Input devices
 
Chapter 03 game input
Chapter 03 game inputChapter 03 game input
Chapter 03 game input
 
Input devices
Input devicesInput devices
Input devices
 
Presentation(Input,output,stoarage)
Presentation(Input,output,stoarage)Presentation(Input,output,stoarage)
Presentation(Input,output,stoarage)
 
Input devices
Input devicesInput devices
Input devices
 
Hint 1 2D array of type Button, all buttons hidden except for one.pdf
Hint 1 2D array of type Button, all buttons hidden except for one.pdfHint 1 2D array of type Button, all buttons hidden except for one.pdf
Hint 1 2D array of type Button, all buttons hidden except for one.pdf
 
Input Devices
Input DevicesInput Devices
Input Devices
 
Various input devices showing their features
Various input devices showing their featuresVarious input devices showing their features
Various input devices showing their features
 
Input devices
Input  devicesInput  devices
Input devices
 
Input devices
Input devicesInput devices
Input devices
 
Computer fundamental 2 Some information about computer. its input device and ...
Computer fundamental 2 Some information about computer. its input device and ...Computer fundamental 2 Some information about computer. its input device and ...
Computer fundamental 2 Some information about computer. its input device and ...
 

Recently uploaded

ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 

Recently uploaded (20)

ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 

grahics

  • 2. RM [2]-2 Input Devices  Logical Input Devices Categorized based on functional characteristics. Each device transmits a particular kind of data. The different types of data are called input primitives.  Physical Input Devices Categorized based on the physical machine.
  • 3. RM [2]-3 Logical Input Devices  Locator Devices Input Primitive: Coordinate position (x,y) Examples: Mouse, Keyboard (Cursor- Position Keys), Tablet(Digitizer), Trackballs, Lightpens. Applications: Interactive drawing and editing, Graph digitizing.
  • 6. RM [2]-6 Logical Input Devices  String Devices Input Primitive: A string of characters Example: Keyboard Applications: Text input
  • 7. RM [2]-7 Logical Input Devices  Valuator Input primitive: Scalar values (typically between 0 and 1). Examples: Control Dials, Sensing devices, Joysticks Applications: Input of graphics parameters, Graphics representation of analog values, Process simulation, Games.
  • 8. RM [2]-8 Logical Input Devices  Choice Input primitive: A selection from a list of options. Examples: Mouse, Keyboard (Function Keys), Touch Panel etc Applications: Interactive menu selection, Program control.
  • 9. RM [2]-9 Logical Input Devices  Pick Input primitive: Selection of a part of the screen. Examples: Mouse, Cursor Keys, Tablet. Applications: Interactive editing and positioning.
  • 10. RM [2]-10 Physical Input Devices  Keyboard (input functions: String, Choice, Locator).  Mouse (input functions: Locator, Pick, Choice).  Joystick (input functions: Locator, Valuator).  Knob (Valuator).  Tablet (Locator, Pick).
  • 11. RM [2]-11 3D Interaction Devices (Recent additions) These devices are used in advanced rendering methods and virtual reality systems for providing information about three dimensional positions and motion.Few examples are 1. DATA GLOVES 2. SPACE BALLS 3. IMAGING SENSORS These devices are used in advanced rendering methods and virtual reality systems for providing information about three dimensional positions and motion.Few examples are 1. DATA GLOVES 2 SPACE BALLS
  • 12. RM [2]-12 Space Ball, Data Glove
  • 13. RM [2]-13 Event Driven Programming Event Call-back Functions • Mouse clicked. • Mouse dragged. • A key is pressed. • The window is resized. • The window is moved. • Register. • Define. Event Queue
  • 14. RM [2]-14 Mouse Interaction  Mouse Event Event that occurs when the mouse button is pressed or released.  Mouse Motion Event Event that occurs when the mouse is moved while one of the buttons is pressed.
  • 15. RM [2]-15 Mouse Event  Contains the following information: Button: The mouse button that is pressed – left, middle, right. State: The state of the button – up, down. Position: The position of the mouse when the event occurs (x, y).
  • 16. RM [2]-16 Mouse Event (OpenGL) Registering with Mouse Event: glutMouseFunc(myMouse); Call-back function: void myMouse(int button, int state, int x, int y) Values for button: GLUT_LEFT_BUTTON, GLUT_MIDDLE_BUTTON GLUT_RIGHT_BUTTON Values for state: GLUT_UP, GLUT_DOWN x, y: Screen coordinates of mouse position (origin at top-left corner).
  • 17. RM [2]-17 Mouse Motion Event  Contains the following information: Position: The current position of the mouse as the mouse is being dragged holding one of the buttons pressed. The events are continuously generated as the mouse button is pressed and dragged.
  • 18. RM [2]-18 Mouse Motion Event (OpenGL) Registering with Mouse Motion Event: glutMotionFunc(myMovedMouse); Call-back function: void myMovedMouse(int x, int y) x, y: Screen coordinates of mouse position (origin at top-left corner).
  • 19. RM [2]-19 Keyboard Event  Contains the following information: key: The ASCII value of the key pressed. Position: The current position of the mouse when the key is pressed.
  • 20. RM [2]-20 Keyboard Event (OpenGL) Registering with Keyboard Event: glutKeyboardFunc(myKeyboard); Call-back function: void myKeyboard(unsigned int key, int x, int y) Values of key: ASCII value for normal keys GLUT_KEY_LEFT, GLUT_KEY_RIGHT..(Arrow keys) x, y: Screen coordinates of mouse position (origin at top-left corner).
  • 21. RM [2]-21 Window Events  The Window Redraw Event occurs whenever the window needs to be redrawn. This happens when the window is first opened and when the window is exposed by moving another window off of it.  The Window Reshape Event is generated when the window is resized with the mouse.
  • 22. RM [2]-22 Window Events (OpenGL) Registering with Window Redraw Event: glutDisplayFunc(myDisplay); Registering with Window Reshape Event: glutReshapeFunc(myReshape);