Computer Graphics Chapter 2 Input Devices 1 Input

  • Slides: 22
Download presentation
Computer Graphics Chapter 2 Input Devices 1

Computer Graphics Chapter 2 Input Devices 1

Input Devices n n Logical Input Devices u Categorized based on functional characteristics. u

Input Devices n n Logical Input Devices u Categorized based on functional characteristics. u Each device transmits a particular kind of data. u The different types of data are called input primitives. Physical Input Devices u RM Categorized based on the physical machine. 2

Logical Input Devices n RM Locator Devices u Input Primitive: Coordinate position (x, y)

Logical Input Devices n RM Locator Devices u Input Primitive: Coordinate position (x, y) u Examples: Mouse, Keyboard (Cursor. Position Keys), Tablet(Digitizer), Trackballs, Lightpens. u Applications: Interactive drawing and editing, Graph digitizing. 3

Digitizer RM 4

Digitizer RM 4

Joystick and Trackball RM 5

Joystick and Trackball RM 5

Logical Input Devices n RM String Devices u Input Primitive: A string of characters

Logical Input Devices n RM String Devices u Input Primitive: A string of characters u Example: Keyboard u Applications: Text input 6

Logical Input Devices n RM Valuator u Input primitive: Scalar values (typically between 0

Logical Input Devices n RM Valuator u Input primitive: Scalar values (typically between 0 and 1). u Examples: Control Dials, Sensing devices, Joysticks u Applications: Input of graphics parameters, Graphics representation of analog values, Process simulation, Games. 7

Logical Input Devices n RM Choice u Input primitive: options. A selection from a

Logical Input Devices n RM Choice u Input primitive: options. A selection from a list of u Examples: Mouse, Keyboard (Function Keys), Touch Panel etc u Applications: Interactive menu selection, Program control. 8

Logical Input Devices n RM Pick u Input primitive: Selection of a part of

Logical Input Devices n RM Pick u Input primitive: Selection of a part of the screen. u Examples: Mouse, Cursor Keys, Tablet. u Applications: Interactive editing and positioning. 9

Physical Input Devices n n RM Keyboard (input functions: String, Choice, Locator). Mouse (input

Physical Input Devices n n RM Keyboard (input functions: String, Choice, Locator). Mouse (input functions: Locator, Pick, Choice). n Joystick (input functions: Locator, Valuator). n Knob (Valuator). n Tablet (Locator, Pick). 10

3 D Interaction Devices (Recent additions) These devices are used in advanced rendering methods

3 D 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. 2 RM DATA GLOVES SPACE BALLS 11

Space Ball, Data Glove RM 12

Space Ball, Data Glove RM 12

Event Driven Programming · Mouse clicked. · Mouse dragged. · A key is pressed.

Event Driven Programming · Mouse clicked. · Mouse dragged. · A key is pressed. · The window is resized. · The window is moved. Event · Register. · Define. Call-back Functions Event Queue RM 13

Mouse Interaction n Mouse Event u n Mouse Motion Event u RM Event that

Mouse Interaction n Mouse Event u n Mouse Motion Event u RM Event that occurs when the mouse button is pressed or released. Event that occurs when the mouse is moved while one of the buttons is pressed. 14

Mouse Event n RM Contains the following information: u Button: The mouse button that

Mouse Event n RM Contains the following information: u Button: The mouse button that is pressed – left, middle, right. u State: The state of the button – up, down. u Position: The position of the mouse when the event occurs (x, y). 15

Mouse Event (Open. GL) RM 16

Mouse Event (Open. GL) RM 16

Mouse Motion Event n Contains the following information: u RM Position: The current position

Mouse Motion Event n Contains the following information: u RM 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. 17

Mouse Motion Event (Open. GL) RM 18

Mouse Motion Event (Open. GL) RM 18

Keyboard Event n RM Contains the following information: u key: The ASCII value of

Keyboard Event n RM Contains the following information: u key: The ASCII value of the key pressed. u Position: The current position of the mouse when the key is pressed. 19

Keyboard Event (Open. GL) RM 20

Keyboard Event (Open. GL) RM 20

Window Events n n RM The Window Redraw Event occurs whenever the window needs

Window Events n n RM 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. 21

Window Events (Open. GL) RM 22

Window Events (Open. GL) RM 22