Input and Interaction



Similar documents
Input and Interaction. Project Sketchpad. Graphical Input. Physical Devices. Objectives

Input and Interaction. CS 432 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science

Input and Interaction. Objectives

Graphics Input Primitives. 5. Input Devices Introduction to OpenGL. String Choice/Selection Valuator

OpenGL & Delphi. Max Kleiner. 1/22

The mouse callback. Positioning. Working with Callbacks. Obtaining the window size. Objectives

CMSC 427 Computer Graphics 1

An Introduction to. Graphics Programming

CMSC 427 Computer Graphics 1

Computer Graphics. Computer graphics deals with all aspects of creating images with a computer

Computer Graphics (Basic OpenGL, Input and Interaction)

CS 378: Computer Game Technology

SYMETRIX SOLUTIONS: TECH TIP August 2015

Lecture 3: Coordinate Systems and Transformations

Keyboard Mouse and Menus

Asset Track Getting Started Guide. An Introduction to Asset Track

Lesson 10: Video-Out Interface

Flash MX 2004 Animation Lesson

Computer Graphics Labs

The Keyboard One of the first peripherals to be used with a computer and is still the primary input device for text and numbers.

TabletWorks Help Index 1

PN-L702B LCD MONITOR TOUCH PANEL DRIVER OPERATION MANUAL. Version 2.1

ASSEMBLY PROGRAMMING ON A VIRTUAL COMPUTER

Interaction: Mouse and Keyboard DECO1012

Quick installation guide for the Vista Quantum QNVR Network Video Recorder

SMART Board Software for Macintosh FAQ

AD201, STC106, STC109, STC204, STC302, STC304, STC309, STC311

Below is a diagram explaining the data packet and the timing related to the mouse clock while receiving a byte from the PS-2 mouse:

Interactive Whiteboard Functionality Overview Choosing Pen Style Erasing / Modifying Writing Undo / Redo

PowerPoint 2013: Basic Skills

1. Computer System Structure and Components

Blender Notes. Introduction to Digital Modelling and Animation in Design Blender Tutorial - week 9 The Game Engine

The CAD interface is comprised of two different screens: the graphic/drawing screen and the text screen.

Chapter 8 Operating Systems and Utility Programs

13-1. This chapter explains how to use different objects.

Euler s Method and Functions

Video Tracking Software User s Manual. Version 1.0

STEP 7 MICRO/WIN TUTORIAL. Step-1: How to open Step 7 Micro/WIN

Intel Extreme Graphics 2 User s Guide for Version 14.x Driver Releases

PowerPoint 2007 Basics Website:

Working With Animation: Introduction to Flash

Silverlight for Windows Embedded Graphics and Rendering Pipeline 1

Implementação. Interfaces Pessoa Máquina 2010/ Salvador Abreu baseado em material Alan Dix. Thursday, June 2, 2011

Software User s Guide - ArizonaSun

Computer Graphics Labs

X Series Application Note 43:

Help. Contents Back >>

Lesson 4. Temporal Management of Layers

CREATE A 3D MOVIE IN DIRECTOR

ChemPad3. a tutorial. Ben Shine and Dana Tenneson. May 21, 2008

Lecture Notes, CEng 477

EET 310 Programming Tools

C&A AR Online Credit Card Processor Installation and Setup Instructions with Process Flow

USER MANUAL GUIMGR Graphical User Interface Manager for FRM301/FRM401 Media Racks

Using the Game Boy Advance to Teach Computer Systems and Architecture

PIC 10A. Lecture 7: Graphics II and intro to the if statement

Gursharan Singh Tatla Page No. 1 COMPUTER GRAPHICS (Short Answer type Questions)

Chapter One Introduction to Programming

Bitrix Site Manager 4.0. Quick Start Guide to Newsletters and Subscriptions

Stored Documents and the FileCabinet

Click to view Web Link, click Chapter 8, Click Web Link from left navigation, then click BIOS below Chapter 8 p. 395 Fig. 8-4.

Chapter 5 Understanding Input. Discovering Computers Your Interactive Guide to the Digital World

Parallels Remote Application Server

Canterbury Maps Quick Start - Drawing and Printing Tools

Informatica e Sistemi in Tempo Reale

ME Week 11 Introduction to Dynamic Simulation

2 ASCII TABLE (DOS) 3 ASCII TABLE (Window)

Message Display and Message Archiving 1/2

Visual Tutorial Basic Edition 1. Visual. Basic Edition Tutorial.

VisTablet Manual. For 12 VT Original and Mini Mouse

Wincopy Screen Capture

As you look at an imac you will notice that there are no buttons on the front of the machine as shown in figure 1.

Creating a Poster in PowerPoint A. Set Up Your Poster

#include <Gamer.h> Gamer gamer; void setup() { gamer.begin(); } void loop() {

QUICK REFERENCE: ADOBE ILLUSTRATOR CS2 AND CS3 SECTION 1: CS3 TOOL BOX: PAGE 2 SECTION 2: CS2 TOOL BOX: PAGE 11

Creating a 2D Game Engine for Android OS. Introduction

Epson Brightlink Interactive Board and Pen Training. Step One: Install the Brightlink Easy Interactive Driver

CS130 - Intro to computer graphics. Dr. Victor B. Zordan vbz@cs.ucr.edu Objectives

Inking in MS Office 2013

EARTH PEOPLE TECHNOLOGY SERIAL GRAPH TOOL FOR THE ARDUINO UNO USER MANUAL

CONTROL MICROSYSTEMS DNP3. User and Reference Manual

Module 1. 4 Login-Send Message to Teacher

Using Process Monitor

The Waves Dorrough Meter Collection. User Guide

Anime Studio Debut 10 Create Your Own Cartoons & Animations!

REFERENCE GUIDE 1. INTRODUCTION

IT 386: 3D Modeling and Animation. Review Sheet. Notes from Professor Nersesian s IT 386: 3D Modeling and Animation course

Universal Simple Control, USC-1

Monitor Characteristics

Graphics Pipeline in a Nutshell

Windows XP Pro: Basics 1

Computer Science 217

One-Minute Spotlight. The Crystal Ball Forecast Chart

The 104 Duke_ACC Machine

Transcription:

Input and Interaction 1

Objectives Introduce basic input devices Physical Devices Logical Devices Input Modes Event-driven input Introduce double buffering for smooth animations Programming event input with GLUT 2

Project Sketchpad Ivan Sutherland (MIT 1963) Established basic interactive paradigm Characterizes interactive computer graphics: User sees object on display User points to (picks) object with input device (light pen, mouse, trackball) Object changes (moves, rotates, morphs) Repeat 3

Graphical Input Devices can be described either by Physical properties Mouse Keyboard Trackball Logical Properties What is returned to program via API A position An object identifier Modes How and when input is obtained Request or event 4

Physical Devices mouse trackball light pen data tablet joy stick space ball 5

Incremental (Relative) Devices Devices such as data tablet return position directly to OS Devices such as mouse, trackball, and joy stick return incremental inputs (or velocities) to OS Must integrate these inputs to obtain absolute position Rotation of cylinders in mouse Roll of trackball Difficult to obtain absolute position Can get variable sensitivity 6

Logical Devices Consider the C and C++ code C++: cin >> x; C: scanf ( %d, &x); What is the input device? Can t tell from the code Could be keyboard, file, output from another program Code provides logical input Number (int) returned to program regardless of physical device 7

Graphical Logical Devices Graphical input more varied than input to standard programs Usually numbers, characters, or bits Two older APIs (GKS, PHIGS) defined six types of logical input Locator: return a position Pick: return ID of an object Keyboard: return strings of characters Stroke: return array of positions Valuator: return floating point number Choice: return one of n items 8

X Window Input X Window System introduced client-server model for network of workstations Client: OpenGL program Graphics Server: bitmap display with pointing device and keyboard 9

Input Modes Input devices contain trigger Can be used to send signal to OS Button on mouse Press or release key When triggered, input devices return information (their measure) to system Mouse returns position information Keyboard returns ASCII code 10

Request Mode Input provided to program only when user triggers device Typical of keyboard input Can erase (backspace), edit, correct until enter (return) key (the trigger) depressed 11

Event Mode Most systems have > 1 input device Each can be triggered at arbitrary time by user Each trigger generates event ==> measure put in event queue ==> can be examined by user program 12

Event Types Window: resize, expose, iconify Mouse: click one or more buttons Motion: move mouse Keyboard: press or release a key Idle: nonevent Define what should be done if no other event is in queue 13

Callbacks Programming interface for eventdriven input Define callback function for each type of event graphics system recognizes This user-supplied function executed when event occurs GLUT example: glutmousefunc(mymouse) mouse callback function 14

GLUT callbacks GLUT recognizes subset of events recognized by any particular window system (Windows, X, Macintosh) -glutdisplayfunc -glutmousefunc -glutreshapefunc -glutkeyboardfunc -glutidlefunc -glutmotionfunc, glutpassivemotionfunc 15

GLUT Event Loop Recall that last line in main.c for program using GLUT must be glutmainloop(); ==> put program in infinite event loop In each pass through event loop, GLUT looks at events in queue for each event in queue, GLUT executes appropriate callback function if one is defined if no callback defined for event, event is ignored 16

The display callback Display callback executed whenever GLUT determines that window should be refreshed For example When window first opened When window reshaped When window exposed When user program decides it wants to change display In main.c - glutdisplayfunc(mydisplay) identifies function to be executed Every GLUT program must have a display callback 17

Posting redisplays Many events may invoke display callback function Can lead to multiple executions of display callback on single pass through event loop Can avoid this problem by instead using glutpostredisplay(); ==> sets a flag GLUT checks to see if flag set at end of event loop If set ==> display callback function is executed 18

Animating a Display When redraw display through display callback, usually start by clearing window -glclear() then draw altered display Problem: drawing of information in frame buffer is decoupled from display of its contents Graphics systems use dual ported memory Hence we can see partially drawn display See program single_double.c for example with rotating cube 19

Double Buffering Instead of one color buffer, use two Front Buffer: displayed but not written to Back Buffer: written to but not displayed Program then requests double buffer in main.c -glutinitdisplaymode(gl_rgb GL_DOUBLE) At end of display callback buffers are swapped void mydisplay() { glclear(gl_color_buffer_bit.). /* draw graphics here */. glutswapbuffers() } 20

Using the idle callback Idle callback executed whenever there are no events in event queue -glutidlefunc(myidle) Useful for animations void myidle() { /* change something */ t += dt glutpostredisplay(); } Void mydisplay() { glclear(); /* draw something that depends on t */ glutswapbuffers(); } 21

Using globals Form of all GLUT callbacks fixed void mydisplay() void mymouse(glint button, GLint state, GLint x, GLint y) Must use globals to pass information to callbacks float t; /*global */ void mydisplay() { /* draw something that depends on t } 22