1 Input and Interaction. 2 Input Devices Physical input devices Keyboard devices and pointing devices Logical input devices.

Slides:



Advertisements
Similar presentations
OpenGL CMSC340 3D Character Design & Animation. What is OpenGL? A low-level graphics library specification designed for use with the C and C++ provides…
Advertisements

Better Interactive Programs
Animation and Input CSCI Day Six. Animation Basic Steps to Draw Something: var vertices = [ … ]; var BufferId = gl.CreateBuffer(); gl.bindBuffer.
1 Computer Graphics Chapter 2 Input Devices. RM[2]-2 Input Devices Logical Input Devices  Categorized based on functional characteristics.  Each device.
Chapter 3: Input and Interaction Instructor: Shih-Shinh Huang 1.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Better Interactive Programs Ed Angel Professor of Computer Science, Electrical and Computer.
InteractionHofstra University1 Graphics Programming Input and Interaction.
31/1/2006Based on: Angel (4th Edition) & Akeine-Möller & Haines (2nd Edition)1 CSC345: Advanced Graphics & Virtual Environments Lecture 3: Introduction.
InteractionHofstra University1 Graphics Programming Input and Interaction.
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 GLUT Callback Functions.
Based on slides created by Edward Angel
CSC461 Lecture 9: GLUT Callbacks Objectives Introduce double buffering for smooth animations Programming event input with GLUT.
Input and Interaction Dr. Yingcai Xiao. A good user interface allows users to perform interaction tasks with ease and joy. WYSIWYG (What you see is what.
Informationsteknologi Tuesday, November 6, 2007Computer Graphics - Class 41 Today’s class Input and interaction.
CS 480/680 Computer Graphics Programming with Open GL Part 8: Working with Callbacks Dr. Frederick C Harris, Jr. Fall 2011.
Suriyong L., Computer Multimedia1 Input and Interaction Interactive program is something make CG look interesting.
19/4/ :32 Graphics II Syllabus Selection and Picking Session 1.
Interactive Input Methods & Graphical User Input
CSC461 Lecture 11: Interactive Programs Contents and Objectives Picking Writing modes – XOR/Copy Rubberbanding Display list.
CGMB214: Introduction to Computer Graphics
Introduction to OpenGL and GLUT GLUT. What is OpenGL? An application programming interface (API) A (low-level) Graphics rendering API Generate high-quality.
1 Working with Callbacks Yuanfeng Zhou Shandong University.
COMPUTER GRAPHICS Hochiminh city University of Technology Faculty of Computer Science and Engineering CHAPTER 03: Input & Interaction.
WORKING WITH CALLBACKS Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico Angel: Interactive.
Fundamentals of Computer Graphics Part 3 prof.ing.Václav Skala, CSc. University of West Bohemia Plzeň, Czech Republic ©2002 Prepared with Angel,E.: Interactive.
Interaction with Graphics System
Lecture 5: Interaction 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 711,  ex 2271 
1 k Jarek Rossignac,  2008 Processing  Install Processing  Learn how to edit, run, save, export, post programs  Understand.
School of Computer Science University of Seoul. 1. Interaction 2. Input Devices 3. Clients and Servers 4. Display Lists 5. Programming Event-Driven Input.
Input and Interaction Chapter 3. CS 480/680 2Chapter 3 -- Input and Interaction Introduction: Introduction: We now turn to the development of interactive.
1Computer Graphics Input and Interaction Lecture 8 John Shearer Culture Lab – space 2
CAP 4703 Computer Graphic Methods Prof. Roy Levow Lecture 3.
Input and Interaction Lecture No. 4.
Lecture 3 OpenGL.
Computer Graphics I, Fall 2010 Input and Interaction.
Computing & Information Sciences Kansas State University Lecture 20 of 42CIS 636/736: (Introduction to) Computer Graphics Lecture 21 of 42 William H. Hsu.
CS 480/680 Computer Graphics Programming with Open GL Part 7: Input and Interaction Dr. Frederick C Harris, Jr. Fall 2011.
1 Better Interactive Programs. 2 Objectives Learn to build more sophisticated interactive programs using ­Picking Select objects from the display Three.
CSCE 121: Introduction to Program Design and Concepts, Honors Dr. J. Michael Moore Spring 2015 Set 15: GUIs 1.
Computer Graphics Chapter 6 Andreas Savva. 2 Interactive Graphics Graphics provides one of the most natural means of communicating with a computer. Interactive.
Program 2 due 02/01  Be sure to document your program  program level doc  your name  what the program does  each function  describe the arguments.
1 Input and Interaction. 2 Objectives Introduce the basic input devices ­Physical Devices ­Logical Devices ­Input Modes Event-driven input Introduce double.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Computer Graphics I, Fall 2010 Working with Callbacks.
University of New Mexico
GLUT functions glutInit allows application to get command line arguments and initializes system gluInitDisplayMode requests properties for the window.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
12/22/ :38 1 Comp 175C - Computer Graphics Dan Hebert Computer Graphics Comp 175 Chapter 3 Instructor: Dan Hebert.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Input and Interaction Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Graphics Programming. Graphics Functions We can think of the graphics system as a black box whose inputs are function calls from an application program;
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Working with Callbacks.
Chapter 5 Introduction to Defining Classes Fundamentals of Java.
Graphics Graphics Korea University kucg.korea.ac.kr 1 Interaction and Animation 고려대학교 컴퓨터 그래픽스 연구실.
Working with Callbacks
Better Interactive Programs
CSC461 Lecture 8: Input Devices
Introduction to Computer Graphics with WebGL
The User Interface Lecture 2 Mon, Aug 27, 2007.
Input and Interaction Chapter 3.
Input and Interactions
Interactive Input Methods & Graphical User Input
Working with Callbacks
Better Interactive Programs
Isaac Gang University of Mary Hardin-Baylor
Fundamentals of Computer Graphics Part 3
Input and Interaction Ed Angel
Interactive Input Methods & Graphical User Input
University of New Mexico
Input and Interaction Ed Angel
Input and Interaction Ed Angel Professor Emeritus of Computer Science,
Presentation transcript:

1 Input and Interaction

2 Input Devices Physical input devices Keyboard devices and pointing devices Logical input devices

3 Pointing Devices – 1/2 Mouse Mechanical versus optical Trackball Trackpoint (Pressure-sensitive) Data tablet

4 Pointing Devices – 2/2 Lightpen Light-sensing device Joystick Two velocities Variable-sentivity device Haptic device Spaceball Six degrees of freedom Data gloves

5 Positioning Relative Mouse, trackball, trackpoint Absolute Data tablet

6 Logical Input Devices – 1/2 Characteristics The measurements returned to the programs The time these measurements returned Six classes

7 Logical Input Devices – 2/2 String: by keyboard Locator: by mouse or trackball Pick: id of the selected object is returned Choice: select one of a distinct number of options, e.g. menus Dial or valuators: e.g. slidebars Stroke: returns an array of locations: multiple uses of a locator, could be implemented by a “mouse dragging”

8 Clients and Servers Servers: provide services Print servers, file servers, graphics servers… Clients: users and user programs that make use of these services OpenGL application programs

9 Programming Event-Driven Input Using the pointing device Move event Mouse is moved and one of the button pressed Passive move event Mouse is moved and no buttons are pressed Mouse event: one of mouse buttons is pressed or released glutMouseFunc(mouse): register the function void mouse(int button, int state, int x, int y)

10 Other Events and CallBacks Reshape event: whenever the window is resized glutReshapeFunc(myReshape); Motion event: glutMotionFunc(drawSquare); Keyboard event: glutKeyboardFunc(keyboard); void keyboard(unsigned char key, int x, int y) { if(key==‘q’ || key == ‘Q’) exit(); }

11 Display and Idle CallBacks glutDisplay(display); Idle callback: is invoked when there is no other events Callback could be changed at any time or disabled by set to NULL

12 A Program Example: Drawing Squares with Mouse?

13 A Program Example: Drawing Squares with Mouse Demo

14 A Simple Paint Program – 1/4 Draw geometric primitives: line segments, polygons Manipulate pixels Control attributes of primitives Include menus Should behave correctly when moved or resized

15 A Simple Paint Program – 2/4 Initial display of paint program Menu structure of paint program

16 A Simple Paint Program – 3/4 Five drawing modes: line segment, rectangle, triangle, pixel, and text Two (or three) clicks determine the locations of the end points of line segments, rectangles… Choose colors, pixel size, fill patterns…

17 A Simple Paint Program – 4/4 Demo

18 Animating Interacitve Programs A Rotating Square – 1/4 x=cos  y=sin  (cos , sin  ), (-sin , cos  ), (-cos , -sin  ), (sin , -cos  ) lie on the unit circle

19 A Rotating Square 2/2 Demo

20 Double Buffering How to avoid flickering?

21 Design of Interactive Programs A smooth display with no flickering A variety of interactive devices A variety of methods for entering and displaying information An easy-to-use interface Feedback to the user Tolerance for user error Consider human factors

22 Rubberbanding Demo

23 Logic Operation Copy or replacement mode There are 16 possible operations between 2 bits Source pixel and destination pixel d=d  s, where  means XOR (exclusive or) d=(d  s)  s, which means drawing something twice will erase it OpenGL support all 16 logic modes, GL_COPY is the default glEnable(GL_COLOR_LOGIC_OP); glLogicOP(GL_XOR); /* change it to XOR mode */

24 Summary and Notes Input devices Event mode and callbacks Sample interaction code Double buffering XOR and Rubberbanding