User Interaction. User Interaction. Input devices. Input devices. Input devices GUIs and GUI design Event-driven programming 3D interaction

Similar documents
CS 465 Program 4: Modeller

Event-driven Programming: GUIs

Interaction Style Categories. COSC 3461 User Interfaces. Windows. Window Manager

Computer Graphics 1. Chapter 9 (July 1st, 2010, 2-4pm): Interaction in 3D. LMU München Medieninformatik Andreas Butz Computergraphik 1 SS2010

Interacting with a 3D World

CS 381 Computer Graphics, Fall 2008 Midterm Exam Solutions. The Midterm Exam was given in class on Thursday, October 23, 2008.

Input (part 2: input models)

CHAPTER 1 Graphics Systems and Models 3

Pipeline Operations. CS 4620 Lecture 14

Geometric Transformations

Pipeline Operations. CS 4620 Lecture 10

Fall UI Design and Implementation 1

Assembly and Cutaway Illustration & Interaction

Input: Interaction Techniques

3D Transformations. CS 4620 Lecture 10. Cornell CS4620 Fall 2014 Lecture Steve Marschner (with previous instructors James/Bala)

Solid surface modeling in AutoCAD

Windows and Events. created originally by Brian Bailey

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane

User Interface Design

Detailed Table of content. 3D View by tools - Header. 3D View by tools - Header detailed

3D Viewing. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 9

3D Viewing. CS 4620 Lecture 8

2D/3D Geometric Transformations and Scene Graphs

XSI TO SINS: COMMANDS & SHORTCUTS

Autodesk Moldflow Insight AMI User Interface

Computer Graphics. Lecture 9 Environment mapping, Mirroring

Flair Geometry Editor Part I. Beginners FLUKA Course

CIS 580, Machine Perception, Spring 2015 Homework 1 Due: :59AM

Creating the Tilt Game with Blender 2.49b

CS418 OpenGL & GLUT Programming Tutorial (IV) MP2 Bonus/Object Picking. Presented by : Wei-Wen Feng 2/20/2008

Lecture 10: Input, Interaction & callbacks. CITS 3003 Graphics & Animation

CS 4300 Computer Graphics

Input devices are hardware devices that allow data to be entered into a computer.

Figure 1: NC > 2 Axis menu > Options

Autodesk Navisworks Freedom Quick Reference Guide

3D Transformations. CS 4620 Lecture Kavita Bala w/ prior instructor Steve Marschner. Cornell CS4620 Fall 2015 Lecture 11

Event Dispatch. Interactor Tree Lightweight vs. Heavyweight Positional Dispatch Focus Dispatch. 2.4 Event Dispatch 1

Computer Graphics Lecture 2

Lecture 4. Viewing, Projection and Viewport Transformations

C P S C 314 S H A D E R S, O P E N G L, & J S RENDERING PIPELINE. Mikhail Bessmeltsev

Week 1 The Blender Interface and Basic Shapes

Notes on Assignment. Notes on Assignment. Notes on Assignment. Notes on Assignment

Graphics pipeline and transformations. Composition of transformations

CS 381 Computer Graphics, Fall 2012 Midterm Exam Solutions. The Midterm Exam was given in class on Tuesday, October 16, 2012.

CS260. UI Toolkits. Björn Hartmann University of California, Berkeley EECS, Computer Science Division Fall 2010

CMSC427 Interac/ve programs in Processing: Polyline editor

Shadows in the graphics pipeline

How Computer Mice Work

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11

The Wireframe Update Buttons. The Frontface and Backface Buttons. The Project Designer 265

UI Toolkits. HCID 520 User Interface Software & Technology

Lecture 3 Sections 2.2, 4.4. Mon, Aug 31, 2009

Implementing the IBar Camera Widget

CIS 580, Machine Perception, Spring 2016 Homework 2 Due: :59AM

Another Look at Camera Control

CS123. Programming Your Personal Robot. Part 2: Event Driven Behavior

Blender Notes. Introduction to Digital Modelling and Animation in Design Blender Tutorial - week 1 The Blender Interface and Basic Shapes

CS230 : Computer Graphics Lecture 6: Viewing Transformations. Tamar Shinar Computer Science & Engineering UC Riverside

Input part 3: Interaction Techniques

solidthinking Environment...1 Modeling Views...5 Console...13 Selecting Objects...15 Working Modes...19 World Browser...25 Construction Tree...

Basic Blender Commands This is just a partial list of Blender commands. Please visit the Blender.org website for more details.

solidthinking User Interface

Case Study 1: Piezoelectric Rectangular Plate

Chapter 3 Image Registration. Chapter 3 Image Registration

CS 4620 Program 3: Pipeline

Transformation Hierarchies. CS 4620 Lecture 5

Adobe Flash CS4 Part 4: Interactivity

Graphics Systems and Models

The Department of Construction Management and Civil Engineering Technology CMCE-1110 Construction Drawings 1 Lecture Introduction to AutoCAD What is

Viewer. Release gns-mbh.com

Beaumont Middle School Design Project April May 2014 Carl Lee and Craig Schroeder

1 In the Mini Window Editor, double-click phase 1 (GF-Wall-External) to make it current:

StickFont Editor v1.01 User Manual. Copyright 2012 NCPlot Software LLC

Graphics Pipeline 2D Geometric Transformations

Event Dispatch. Interactor Tree Lightweight vs. Heavyweight Positional Dispatch Focus Dispatch. Event Architecture. A pipeline: Event Capture

Reference Image. Source:

UI Toolkits. HCID 520 User Interface Software & Technology

3.6: First Person Computer Games

Computer Graphics I Lecture 11

Adobe Photoshop Sh S.K. Sublania and Sh. Naresh Chand

Adobe Premiere Pro CC 2015 Tutorial

How to Measure Wedge. Purpose. Introduction. Tools Needed

Chapter 2 Parametric Modeling Fundamentals

A simple OpenGL animation Due: Wednesday, January 27 at 4pm

S206E Lecture 3, 5/15/2017, Rhino 2D drawing an overview

Vector Algebra Transformations. Lecture 4

MORE OPENGL. Pramook Khungurn CS 4621, Fall 2011

Interactive Computer Graphics A TOP-DOWN APPROACH WITH SHADER-BASED OPENGL

An Introduction to Maya. Maya. Used in industrial design, CAD, computer games and motion picture effects. The ambition is what get

SketchUp Tool Basics

Adaptive Point Cloud Rendering

Beginners Guide Maya. To be used next to Learning Maya 5 Foundation. 15 juni 2005 Clara Coepijn Raoul Franker

SketchUp: an Overview. By Norm Berls

Tutorial 4: Texture Mapping Techniques

CSE 167: Introduction to Computer Graphics Lecture #11: Visibility Culling

Movie: Geri s Game. Announcements. Ray Casting 2. Programming 2 Recap. Programming 3 Info Test data for part 1 (Lines) is available

Design av brukergrensesnitt på mobile enheter

INTRODUCTION TO MEDICAL IMAGING- 3D LOCALIZATION LAB MANUAL 1. Modifications for P551 Fall 2013 Medical Physics Laboratory

GETTING STARTED WITH SKETCHUP

Interactive Techniques

Transcription:

User Interaction User Interaction Input devices GUIs and GUI design Event-driven programming 3D interaction CS 465 lecture 19 2003 Steve Marschner 1 2003 Steve Marschner 2 Input devices Input devices Discrete events Keyboard Function keys Mouse buttons Game controller buttons Including multi-way controllers (pseudo-joysticks) Valuators: generate continuous values Rotary knobs (relative or absolute) Recentering or free Joysticks (two valuators in one) Locators: give a continuous 2D position Mechanical mouse (trackball is the same) Two axes with optical encoders Integrate rate of pulses on each axis Result = position Optical mouse Image sensor looking out the bottom Shift and correlate to estimate motion per frame Integrate motion to get position Mouse velocity scaling 2003 Steve Marschner 3 2003 Steve Marschner 4

Input devices Input devices Locators, cont. Multidimensional controllers Pen tablet Directly senses absolute stylus position Often used directly over a display PDA Tablet PC Absolute vs. relative Direct vs. indirect More exotic devices Spaceball Data glove 3D tracker Magnetic Acoustic Optical 2003 Steve Marschner 5 2003 Steve Marschner 6 Graphical User Interfaces (GUIs) Using visual display coupled with pointing to present complex choices to the user The dominant mode of user interface today Many flavors exist, but all present similar widgets Icons (objects) Buttons (actions) Menus (collections of choices/actions) Lists Trees Basic interaction tasks Positioning Selection From large/continuous set (part of image) Rectangle, lasso From unorganized discrete set (icons on desktop) Click and modifier-click, or drag area From linearly organized set Selection from list box From hierarchically organized set Drop-down menus, trees, columnar lists, 2003 Steve Marschner 7 2003 Steve Marschner 8

3 Hierarchy UIs Event driven programming Menu-based text Full-screen text editor Interactive program with pointer Callback-based interactive program GUI program Event-driven GUI program Event routing Non-input events 2003 Steve Marschner 9 2003 Steve Marschner 10 An event-driven system: Java/Swing Event handling machinery The window system is in control (it s the outer loop) All application code executes, directly or indirectly, in response to events 1. Event listeners are registered on components 2. Event generated (asynchronously, by input device, system, or application) 3. Event goes on event queue 4. Event is dequeued in the main event loop and dispatched a) Identify event source b) Call event-handling method on source c) Event-handling method calls all interested listeners 2003 Steve Marschner 11 2003 Steve Marschner 12

Event handling issues Listener/callback style programming encodes the event routing in references (listener lists, etc.), which are dynamic, rather than in code, which is error-prone and static For responsiveness, must avoid long operations in event handlers Long computations Network and file operations Solution: events for asynchronous I/O Solution: fragmented computation and idle events Solution: multiple threads Interaction in graphics Graphics interaction (e.g. drawing) is less constrained Normally based on mouse events Input events: Mouse down, mouse up Mouse moved Mouse clicked (down-up w/o motion) Mouse dragged (motion while button down) All come with info about modifier keys Resize, redraw events Timer events Several common interaction tasks exist 2003 Steve Marschner 13 2003 Steve Marschner 14 Creating 2D objects Manipulating 2D objects Rubberbanding Mouse-down: first point; mouse-up: second point In between, give feedback Rubberbanding is a spring loaded mode Transformations Handle-based interface: easy to learn but limited Center-and-drag interface: more flexible but less direct 2003 Steve Marschner 15 2003 Steve Marschner 16

Implementing interaction How to do this by handling events? Mode implies the need to keep state Implementing interaction State machines: an abstraction for modes mousedown(x, y) { startpt.set(x, y); endpt.set(x, y); rubberband = true; mousemove(x, y) { if (rubberband) { endpt.set(x, y); repaint(); mouseup(x, y) { if (rubberband) { createline(startpt, endpts); rubberband = false; repaint(); (drawing code needs to draw the tentative line) Thinking this way can help with coding complex interactions 2003 Steve Marschner 17 2003 Steve Marschner 18 More complex state machine Interaction with 3D scenes For center-based rotation in Adobe Illustrator (demo) Basically 2D interaction with feedback given via projected view Main challenge: mapping 2D mouse events to 3D operations The camera is very important Determines what can be seen Determines mapping between 2D and 3D Reverse projection is ill-defined! Often multiple cameras are provided 2003 Steve Marschner 19 2003 Steve Marschner 20

3D interaction: points Principle: point should go where you click Creating a point Click specifies a ray, but where is the point? Common solution: intersect with known plane (e.g. a ground plane) Moving a point Mouse motion specifies two rays One possibility: intersect with plane as above Second possibility: move parallel to camera plane Scale motion by z distance to ensure following mouse 3D interaction: translation Principle: click and drag moves object as expected Again, many 3D directions project to the user s 2D motion vector Move parallel to view plane Move parallel to coordinate plane Move parallel to coordinate axis 2003 Steve Marschner 21 2003 Steve Marschner 22 3D interaction: scale 3D interaction: rotation Uniform scale: a 1D input; just use one mouse coord Nonuniform scale: 2 inputs for 3 axes Project to closest axis (like translation example) Map mouse x and y to closest axes Very common operation 2D input for 3 rotations Provide sliders for 3 axes Up/down rotates about horiz.; left/right rotates abot vert. Virtual trackball 2003 Steve Marschner 23 2003 Steve Marschner 24

Virtual trackball rotation A very popular interface for general rotations Concept: you re turning a sphere by grabbing a point and moving it The sphere makes the smallest rotation that follows the mouse Rotation axis is perpendicular to the radii to the two points Rotation angle is determined by angle between radii Selection of 3D objects (picking) How to determine what object a click falls on? Same as visible surface determination problem One solution: use ray tracing (but requires separate infrastructure) Pipeline solution: object ID buffer Draw in hidden buffer with color per object Read back color to determine object belonging to a pixel Pipeline solution: draw scene with tiny viewport Observe what primitives are actually drawn OpenGL provides a callback mechanism for this 2003 Steve Marschner 25 2003 Steve Marschner 26 Manipulating cameras in 3D Quite similar to transforming objects Except you apply the inverse transformation to the camera Nomenclature comes from cinematography Camera translation: dolly for w; track for u (and also v by abuse of terminology) Camera rotation about viewpoint: pan for about v; tilt for about u (common abuse = pan for both); roll for about w (probably from aviation) Camera rotation about target point: orbit Changing angle of view: zoom 2003 Steve Marschner 27