Lecture #5 Interactive Input Methods

Slides:



Advertisements
Similar presentations
1 Computer Graphics Chapter 2 Input Devices. RM[2]-2 Input Devices Logical Input Devices  Categorized based on functional characteristics.  Each device.
Advertisements

CS 450: COMPUTER GRAPHICS GLUT INPUT FUNCTIONS SPRING 2015 DR. MICHAEL J. REALE.
Chapter 3: Input and Interaction Instructor: Shih-Shinh Huang 1.
31/1/2006Based on: Angel (4th Edition) & Akeine-Möller & Haines (2nd Edition)1 CSC345: Advanced Graphics & Virtual Environments Lecture 3: Introduction.
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 GLUT Callback Functions.
Based on slides created by Edward Angel
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.
19/4/ :32 Graphics II Syllabus Selection and Picking Session 1.
Interactive Input Methods & Graphical User Input
Events and Coordinates Lecture 5 Fri, Sep 5, 2003.
CGMB214: Introduction to Computer Graphics
1 Working with Callbacks Yuanfeng Zhou Shandong University.
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 
CS 450: COMPUTER GRAPHICS REVIEW: GLUT INPUT FUNCTIONS SPRING 2015 DR. MICHAEL J. REALE.
School of Computer Science University of Seoul. 1. Interaction 2. Input Devices 3. Clients and Servers 4. Display Lists 5. Programming Event-Driven Input.
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.
1 Input and Interaction. 2 Input Devices Physical input devices Keyboard devices and pointing devices Logical input devices.
Computer Graphics I, Fall 2010 Input and Interaction.
CS 480/680 Computer Graphics Programming with Open GL Part 7: Input and Interaction Dr. Frederick C Harris, Jr. Fall 2011.
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.
Programming in the Simple Raster Graphics Package (SRGP) Chapter 2.
Computer Graphics I, Fall 2010 Working with Callbacks.
Supreeth Venugopal U  Input of graphical data  Input functions  Initial values for input modes  Interactive picture-construction techniques.
Input Devices, User Interface & VR Environments. Sri Kalyan Atluri (U )
University of New Mexico
Pop-Up Menus Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Friday, September 26, 2003.
Mouse events, Advanced camera control George Georgiev Telerik Corporation
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,
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Working with Callbacks.
CSC Graphics Programming Budditha Hettige Department of Statistics and Computer Science.
Basic Program with OpenGL and GLUT
Review GLUT Callback Functions
Human Computer Interaction Lecture 07 The Interaction
Working with Callbacks
Introduction to the Mouse
CSC461 Lecture 8: Input Devices
2D Viewing Pipeline.
Introduction to Computer Graphics with WebGL
Chap 7. Building Java Graphical User Interfaces
The User Interface Lecture 2 Mon, Aug 27, 2007.
Advanced Menuing, Introduction to Picking
Structure Modelling.
Input and Interactions
Introduction to Computer Graphics
Interactive Input Methods & Graphical User Input
Working with Callbacks
Chapter 3 arrays of vertices vertex arrays display lists drawing text
GRAPHICAL USER INTERFACE
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
CSE 411 Computer Graphics Lecture #0 Organizational Issues
Chapter 3 arrays of vertices vertex arrays display lists drawing text
Graphical User Interfaces
Lecture #6 2D Geometric Transformations
Input and Interaction Ed Angel Professor Emeritus of Computer Science,
ITEC220 GUI Lecture – Part 2 References
Presentation transcript:

Lecture #5 Interactive Input Methods CSE 411 Computer Graphics Lecture #5 Interactive Input Methods Prepared & Presented by Asst. Prof. Dr. Samsun M. BAŞARICI 1

Objectives HB Ch. 20 Classification of Input Devices Input Functions Interactive Picture-Construction Techniques GLUT Mouse Functions GLUT Keyboard Functions GLUT Menu Functions Interactive Input Methods

Logical Classification of Input Devices Locator Devices Interactive selection of a coordinate point Mice Joysticks Trackballs Spaceballs Etc. Interactive Input Methods

Logical Classification of Input Devices (cont.) Stroke Devices Input a sequence of coordinate positions Mice (continuous movement) Graphic tablets Etc. Interactive Input Methods

Logical Classification of Input Devices (cont.) String Devices (Character) String input Keyboards Interactive Input Methods

Logical Classification of Input Devices (cont.) Valuator Devices Input a scalar value Faders Trimmers Potentiometers Etc. Interactive Input Methods

Logical Classification of Input Devices (cont.) Choice Devices Selecting menu options Mice Keyboards Etc. Interactive Input Methods

Logical Classification of Input Devices (cont.) Pick Devices Selecting objects Mice Keyboards Joysticks Etc. Interactive Input Methods

Logical Classification of Input Devices (cont.) Pick Devices Example: Selecting one object (x,y) d1 d2 Interactive Input Methods

Logical Classification of Input Devices (cont.) Pick Devices Example: Selecting multiple objects (pick window) ymax ymin xmin xmax Bounding Rectangle Interactive Input Methods

Input Devices Locator Devices: Stroke Devices: String Devices: Specify one coordinate position Stroke Devices: Specify set of coordinate positions String Devices: Specify text input Valuator Devices: Specify scalar value Choice Devices: Select menu options Pick Devices: Select component(s) of a picture Interactive Input Methods

Input Functions for Graphical Data Input Modes: Request mode: Data entry initiated by application program Suspend process, wait for input data Input device and program operate alternately Sample mode: Input device and program operate independent Event mode: Data entry initiated by input device (event initiated) Data stored in queue Interactive Input Methods

Interactive Techniques Positioning Object Displayed at Cursor Position Position Cursor and Press Button Interactive Input Methods

Interactive Techniques Dragging Interactive Input Methods

Interactive Techniques Constraints: Procedure for altering input coordinate values Press Button to Select First Endpoint Press Button to Select Second Endpoint Press Button to Select Second Endpoint Press button to Select First Endpoint Interactive Input Methods

Interactive Techniques Grids A kind of constraint Press Button to Select First Endpoint Press Button to Select Second Endpoint Interactive Input Methods

Interactive Techniques Rubber-Bands Interactive Input Methods

Interactive Techniques Rubber-Bands Press button to start Arc stretches out from start position as cursor moves Pressing stop button & ends process Rectangle stretches out as cursor moves Press button to start Press button to stop Interactive Input Methods

Interactive Techniques Gravity Field Interactive Input Methods

GLUT Input Device Functions Device input is handled by GLUT and not by OpenGL core library Why? Interactive Input Methods

GLUT Mouse Functions glutMouseFunc (mouseFcn); void mouseFcn(GLint button, GLint action, GLint xmouse, GLint ymouse) button GLUT_LEFT_BUTTON, GLUT_MIDDLE_BUTTON, GLUT_RIGHT_BUTTON action GLUT_DOWN , GLUT_UP xmouse, ymouse mouse position relative to window when the button is pressed or released Interactive Input Methods

Example Programs ch20MousePlotPoint.c ch20MousePlotPolyline.c Interactive Input Methods

GLUT Mouse Functions (cont.) glutMotionFunc(fncDoSomething); void fcnDoSomething(GLint xMouse, GLint yMouse) Invokes when mouse moves with a button pressed glutPassiveMotionFunc(fncDoSomethingElse); void fcnDoSomethingElse(GLint xMouse, GLint yMouse) Invokes when mouse moves without pressing a button Interactive Input Methods

GLUT Keyboard Functions glutKeyboardFunc (keyFcn); void keyFcn(GLubyte key, GLint xMouse, GLint yMouse) key is assigned a character value or the corresponding ASCII code Example ch20KeyboardCurveDrawing.c Interactive Input Methods

GLUT Keyboard Functions (cont.) glutSpecialFunc (specialKeyFcn); void specialKeyFcn(GLint specialKey, GLint xMouse, GLint yMouse) specialKey can be GLUT_KEY_F1…GLUT_KEY_F12, GLUT_KEY_UP, GLUT_KEY_RIGHT, GLUT_KEY_PAGE_DOWN, GLUT_KEY_HOME Example ch20MouseKeyboardSquares.c Interactive Input Methods

GLUT Menu Functions (cont.) Creating a GLUT Menu glutCreateMenu (menuFcn); void menuFcn(GLint menuItemNumber) glutAddMenuEntry(charString, menuItemNumber); glutAddMenuEntry(“First Menu Item”, 1); glutAddMenuEntry(“Second Menu Item”, 2); glutAttachMenu (button); Example ch20GLUTMenu.c Interactive Input Methods

GLUT Menu Functions (cont.) Creating and Managing Multiple GLUT Menus menuID = glutCreateMenu (menuFcn); glutSetMenu (menuID); glutDestroyMenu (menuID); currentMenuID = glutGetMenu (); Interactive Input Methods

GLUT Menu Functions (cont.) Creating GLUT Submenus submenuID = glutCreateMenu (subMenuFcn); glutAddMenuEntry(“First Submenu Item”,1); . glutCreateMenu (menuFcn); glutAddMenuEntry(“First Menu Item”,1); glutAddSubMenu (“Submenu Option”,submenuID); Example ch20GLUTSubmenu.c Interactive Input Methods

OpenGL Input Functions Interactive Input Methods

OpenGL Input Functions (cont.) Interactive Input Methods

OpenGL Input Functions (cont.) Interactive Input Methods

OpenGL Input Functions (cont.) Interactive Input Methods

OpenGL Input Functions (cont.) Interactive Input Methods

2D Geometric Transformations Next Lecture 2D Geometric Transformations Interactive Input Methods 34 34

References Donald Hearn, M. Pauline Baker, Warren R. Carithers, “Computer Graphics with OpenGL, 4th Edition”; Pearson, 2011 Sumanta Guha, “Computer Graphics Through OpenGL: From Theory to Experiments”, CRC Press, 2010 Edward Angel, “Interactive Computer Graphics. A Top-Down Approach Using OpenGL”, Addison- Wesley, 2005 Interactive Input Methods 35