Informationsteknologi Tuesday, November 6, 2007Computer Graphics - Class 41 Today’s class Input and interaction.

Slides:



Advertisements
Similar presentations
Better Interactive Programs
Advertisements

Graphics Pipeline.
Computer Graphic Creator: Mohsen Asghari Session 2 Fall 2014.
1 Computer Graphics Chapter 2 Input Devices. RM[2]-2 Input Devices Logical Input Devices  Categorized based on functional characteristics.  Each device.
In the name of God Computer Graphics Bastanfard.
Overview of Graphic Systems
MR.E.S.AGRAWAL SGGSIE&T, NANDED CAD Software and Hardware.
Informationsteknologi Monday, October 29, 2007Computer Graphics - Class 21 Today’s class Graphics programming Color.
When click!! (void) glRenderMode (GL_SELECT); glInitNames(); glPushName(0); glMatrixMode (GL_PROJECTION); glPushMatrix (); glLoadIdentity (); gluPickMatrix.
Chapter 12 Interactive Graphics Chih-Kuo Yeh. Direct Manipulation Demo.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Better Interactive Programs Ed Angel Professor of Computer Science, Electrical and Computer.
Based on slides created by Edward Angel
GCSE Information Technology Input Devices and Methods 3 Manual input devices are used by people to enter data by hand. Keyboard Pointing devices Joystick.
Picking. What is picking? Selecting an object on the screen What does this require? –Get Mouse Location –Compute what objects are rendered at the position.
Course Overview, Introduction to CG Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Friday, September 5, 2003.
Chapter 3 Working with Symbols and Interactivity.
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
Input Devices. What is Input?  Everything we tell the computer is Input.
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.
Image Synthesis Rabie A. Ramadan, PhD 2. 2 Java OpenGL Using JOGL: Using JOGL: Wiki: You can download JOGL from.
Korea University Korea University Computer Graphics Laboratory Computer Graphics Laboratory Jung Lee, Chapter 13.
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.
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.
© 2010 Delmar, Cengage Learning Chapter 3: Working with Symbols and Interactivity.
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.
Virtual Reality Lecture2. Some VR Systems & Applications 고려대학교 그래픽스 연구실.
Creating Buttons – Lesson 71 Creating Buttons Lesson 7.
Adobe Flash CS3 Revealed Chapter 3 - WORKING WITH SYMBOLS AND INTERACTIVITY.
Peter Norton, 6 th edition By: Rena Essa. Lesson 3A:Using the Keyboard and Mouse.
1 Better Interactive Programs. 2 Objectives Learn to build more sophisticated interactive programs using ­Picking Select objects from the display Three.
Computer Graphics Chapter 6 Andreas Savva. 2 Interactive Graphics Graphics provides one of the most natural means of communicating with a computer. Interactive.
OpenGL Selection. Three Selection Methods Color coding (OpenGL) Selection mode (OpenGL) Selection ray (generic)
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: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Macromedia Flash 8 Revealed WORKING WITH SYMBOLS AND INTERACTIVITY.
1 Graphics CSCI 343, Fall 2015 Lecture 6 Viewing, Animation, User Interface.
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
Model Editing James Martin High School Computer Multimedia and Animation Instructor: G. Patton From: CHAPTER 5 – 3DS MAX AND ITS APPLICATIONS.
1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis.
Selection Mode, Introduction to Widgets Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Monday, October 6, 2003.
Computer Graphics Lecture 1 Introduction to Computer Graphics
Reading and Writing Image Files
Better Interactive Programs
CSC461 Lecture 8: Input Devices
Intro to lighting (Chapter 11)
Structure Modelling.
Interactive Input Methods & Graphical User Input
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
Computer Graphics Practical Lesson 8
Input and Interaction Ed Angel
Chapter 2 Overview of Graphics Systems
Lecture #5 Interactive Input Methods
Input and Interaction Ed Angel Professor Emeritus of Computer Science,
ITEC220 GUI Lecture – Part 2 References
Presentation transcript:

Informationsteknologi Tuesday, November 6, 2007Computer Graphics - Class 41 Today’s class Input and interaction

Informationsteknologi Tuesday, November 6, 2007Computer Graphics - Class 42 Interactive input devices Locator  specifies coordinate positions  examples: thumbwheels, tablet, mouse, trackball, joystick, touch panel Stroke  specifies a sequence of coordinate positions  example: tablets

Informationsteknologi Tuesday, November 6, 2007Computer Graphics - Class 43 Interactive input devices (cont.) Pick  selects picture components  example: light pen Valuator  specifies scalar values  example: dial

Informationsteknologi Tuesday, November 6, 2007Computer Graphics - Class 44 Interactive input devices (cont.) String  specifies text input  example: keyboard Choice  selects menu options  examples: keyboard, mouse buttons

Informationsteknologi Tuesday, November 6, 2007Computer Graphics - Class 45 Event driven devices CPU must wait on the device before it can do anything Examples:  keyboard  mouse

Informationsteknologi Tuesday, November 6, 2007Computer Graphics - Class 46 Example: rubberbanding Rubberbanding is the process of having a visual indicator move around the graphics window as the mouse moves Events that need to be recognized are mouse movement and mouse button clicks (to indicate starting and stopping of rubberbanding)

Informationsteknologi Tuesday, November 6, 2007Computer Graphics - Class 47 Overlay planes While rubberbanding the actual image must be preserved This is best accomplished by using an overlay plane, such that the actual image is drawn in the normal draw plane and the rubberbanding shape is drawn in the overlay plane The image seen on the screen is made up of the layering of these two planes:  if a pixel in the overlay plane is transparent, the pixel in the normal draw plane is seen  if a pixel in the overlay plane is a normal color, it is seen and the image’s pixel is hidden

Informationsteknologi Tuesday, November 6, 2007Computer Graphics - Class 48 Overlay planes in OpenGL and GLUT glutEstablishOverlay(); is used to establish an overlay plane glutUseLayer(GLUT_OVERLAY); is used to draw in the overlay plane glutUseLayer(GLUT_NORMAL); is used to return drawing to the normal draw plane OpenGL keeps separate projection matrices for overlay planes

Informationsteknologi Tuesday, November 6, 2007Computer Graphics - Class 49 Example program Program rubberband.c illustrates mouse events and the overlay plane It runs on the SGI and Sun workstations, but not the laptops as Windows does not support overlay planes

Informationsteknologi Tuesday, November 6, 2007Computer Graphics - Class 410 Overview of picking First draw scene into frame buffer as usual Now change to selection mode and redraw the scene (contents of frame buffer will not change until selection mode is exited) Upon exit of selection mode, OpenGL returns a list of primitives that would have intersected the viewing volume

Informationsteknologi Tuesday, November 6, 2007Computer Graphics - Class 411 Overview of picking (cont.) Each of these primitives causes a selection hit The list of primitives returned as an array of integer-valued names and related data (hit records) that correspond to the current contents of the name stack Name stack is constructed by loading names onto it as you issue primitive drawing commands while in selection mode

Informationsteknologi Tuesday, November 6, 2007Computer Graphics - Class 412 Basic steps Specify array to be used for the returned hit records with glSelectBuffer(), which is passed:  maximum number of values that can be stored in the array  an array capable of holding unsigned integers Enter selection mode with glRenderMode (GL_SELECT);

Informationsteknologi Tuesday, November 6, 2007Computer Graphics - Class 413 Basic steps (cont.) Initialise the name stack with glInitNames(); and glPushName (-1); Define the viewing volume you want for selection with the help of gluPickMatrix() (usually different from rendering, so you will want to use glPushMatrix(); and glPopMatrix(); to save and restore rendering transformation

Informationsteknologi Tuesday, November 6, 2007Computer Graphics - Class 414 Basic steps (cont.) Alternately issue commands to alter the name stack and primitive drawing commands so that each primitive of interest has an appropriate name assigned Exit selection mode and process the returned selection data (the hit records)

Informationsteknologi Tuesday, November 6, 2007Computer Graphics - Class 415 Hit records Contents, in order, of a hit record:  Number of names on the name stack when the hit occurred  Minimum and maximum window-coordinate z values of all vertices of the primitives that intersected the viewing volume since the last recorded hit (they lie in the range 0-1 but are multiplied by and rounded to the nearest unsigned integer)

Informationsteknologi Tuesday, November 6, 2007Computer Graphics - Class 416 Hit records (cont.) Contents, in order, of a hit record (cont.):  Contents of the name stack at the time of the hit, with the bottommost element first

Informationsteknologi Tuesday, November 6, 2007Computer Graphics - Class 417 Example program Program picksquare.cpp demonstrates the complete technique for picking