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



Similar documents
OpenGL & Delphi. Max Kleiner. 1/22

Input and Interaction

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

Graphics Pipeline in a Nutshell

Introduction to MS Visual Studio 6.0

CMSC 427 Computer Graphics 1

CMSC 427 Computer Graphics 1

Interaction. Triangles (Clarification) Choice of Programming Language. Display Lists. The CPU-GPU bus. CSCI 480 Computer Graphics Lecture 3

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

Computer Graphics Labs

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

Computer Graphics (Basic OpenGL, Input and Interaction)

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.

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

Computer Graphics. Anders Hast

Chapter 3 Input Devices

USER GUIDE Version 2.0

An Introduction to. Graphics Programming

Chapter 9 Input/Output Devices

2: Introducing image synthesis. Some orientation how did we get here? Graphics system architecture Overview of OpenGL / GLU / GLUT

Using the equipment in teaching rooms

CS 378: Computer Game Technology

STEELSERIES FREE MOBILE WIRELESS CONTROLLER USER GUIDE

COMPUTER - INPUT DEVICES

Programming the VEX Robot

Lecture Notes, CEng 477

PEMBINA TRAILS SCHOOL DIVISION. Information Technology Department. Inspiration 7.0

Aston University. School of Engineering & Applied Science

XI'AN NOVASTAR TECH CO., LTD

Masters of Science in Software & Information Systems

How To Draw On An Ipad With A Touch Tablet (For Free) On A Blackberry Or Ipad 2 (For A Sims) On An Easter Egg (For An Sims 2) On Blackberry 2 (Blackberry)

Input and Interaction. Objectives

Visualization of 2D Domains

Chapter 5 Objectives. Chapter 5 Input

Communicate: In Print

Plotting: Customizing the Graph

1 PERSONAL COMPUTERS

SMART Sympodium and Notebook Software 9.5

Kinect Interface to Play Computer Games with Movement

Tutorial: Biped Character in 3D Studio Max 7, Easy Animation

Finger Paint: Cross-platform Augmented Reality

Creating a Poster in PowerPoint A. Set Up Your Poster

Chapter 5 Input. Chapter 5 Objectives. What Is Input? What Is Input? The Keyboard. The Keyboard

13 Managing Devices. Your computer is an assembly of many components from different manufacturers. LESSON OBJECTIVES

Creating Your Own 3D Models

Computer Graphics on Mobile Devices VL SS ECTS

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

SMART Board Interactive Whiteboard Setup with USB Cable

Fall Lecture 1. Operating Systems: Configuration & Use CIS345. Introduction to Operating Systems. Mostafa Z. Ali. mzali@just.edu.

ImageNow Document Management Created on Friday, October 01, 2010

SMART Board Menu. Full Reference Guide

OPERATING SYSTEM SERVICES

In this session, we will explain some of the basics of word processing. 1. Start Microsoft Word 11. Edit the Document cut & move

Internationalization Programming for Mobile Applications

EasyC. Programming Tips

Microsoft Access is an outstanding environment for both database users and professional. Introduction to Microsoft Access and Programming SESSION

Windows 8.1 Tips and Tricks

The very basic basics of PowerPoint XP

product. Please read this instruction before setup your VenomXTM.

RDM+ Remote Desktop for Android. Getting Started Guide

BrightLink Pro. Quick Reference. BrightLink Interaction. BrightLink Pro Features. 1 Turning on and Calibrating the Projector

National RTAP Marketing Transit Toolkit Customizing Templates in Microsoft Publisher

QUIT MACSCHOOL AND DRAG YOUR SERVER ICONS TO THE TRASH OR HIT THE DISCONNECT BUTTON BESIDE THE SERVER ICON IN THE TOP SIDEBAR

SMART Board Tips & Tricks (version 9.0) Getting Started. SMART Tools vs. SMART Notebook software

Shutting down / Rebooting Small Business Server 2003 Version 1.00

LabVIEW Day 1 Basics. Vern Lindberg. 1 The Look of LabVIEW

SMART BOARD USER GUIDE FOR PC TABLE OF CONTENTS I. BEFORE YOU USE THE SMART BOARD. What is it?

idisplay v.2.0 User Guide

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

ArcGIS Mobile Application User s Guide

RICOH. Quick User Guide For Copying, Printing ing and Faxing

Wincopy Screen Capture

I ntroduction. Accessing Microsoft PowerPoint. Anatomy of a PowerPoint Window

Quick Guide for Polycom VVX 500 Performance Business Media Phone. Document Date: 07/30/13 Document Version: 1.0d

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.

TabletWorks Help Index 1

CMSC 425 Game Programming 1

Getting Started on the Computer With Mouseaerobics! Windows XP

Paladin DesignBase Toolbar Functions

Organizing image files in Lightroom part 2

Weather Capture Software Guide Version 1.4 Revision: June

User Guide. Printing, Copying and Scanning

CREATE A 3D MOVIE IN DIRECTOR

REMOTE DESKTOP SHARING

Internet and Computing Core Certification Guide Module A Computing Fundamentals

Create a Poster Using Publisher

Contents. I. General Information...3. III. Pen Storage and Maintenance...9 IV. Question & Answer...10

SMART BOARD Essentials

The SMART Board Interactive Whiteboard

TH2. Input devices, processing and output devices

SMART Ink 1.5. Windows operating systems. Scan the following QR code to view the SMART Ink Help on your smart phone or other mobile device.

Board Games They are adaptations of classic board games. Examples of board games include Chess, Checkers, Backgammon, Scrabble and Monopoly.

After that you can log in and start creating games or playing existing games.

Adding emphasis to a presentation in PowerPoint 2010 and 2013 for Windows

SketchUp Instructions

Source Code Translation

TestManager Administration Guide

CATIA Basic Concepts TABLE OF CONTENTS

Event processing in Java: what happens when you click?

Transcription:

4ICT10 Computer Graphics and Virtual Reality 5. Input Devices Introduction to OpenGL Dr Ann McNamara String Choice/Selection Valuator Graphics Input Primitives Locator coordinate pair x,y Pick required for interactive graphics 1

Input Devices There are hundreds of input devices Keyboard most familiar input device Early computers communicated one bit at a time Users had to flip switches or plug wires into switchboards to enter data Types characters on screen at point identified by cursor Some keys have special functions Cursor (arrow) keys Delete key Enter key Function keys (f-keys) QWERTY keyboard standard Keyboard 2

Pointing devices Pointing devices are inadequate for input text and numbers into computers. They are usually used with keyboards. Mouse Sends commands Points around screen Trackball Upside down mouse Touch pad Small panel Track point Small joystick IBM ThinkPad and other laptops Joystick Like arcade games Graphics tablets Used by artists and designers Touch Screens Common in kiosks Pointing devices 3

Scanners A 2D scanner converts photographs, drawings, charts and other printed information into bit patterns that can be stored and manipulated in a computer's memory. 3D Scanners 4

3D Scanners Colortron 5

Digital Cameras Convert real world to digital, like scanners Not limited to two dimensional objects Motion Capture 6

4ICT10 Computer Graphics and Virtual Reality Getting Started with OpenGL Requirements An environment that lets us write programs execute programs Hardware to display (screen) Library of software tools to perform drawing of graphics primitives. 7

Device Independent Programming Same program can be compiled and run on a variety of graphics environments. API (Application Programmer Interface) a collection of routines a model of how the routines work Event Driven Programming Windows based systems are event driven mouse click, key press, resize window System automatically handles an event queue Callback Function OpenGL comes with a Utility Toolkit glutmousefunc(mymouse) registers the function mymouse() as the function executed when mouse events occur. 8

OpenGL OpenGL is a software interface to a graphics system implemented in hardware or software. It is theoretically device independent. OpenGL uses a client-server model, where client and server need not reside on the same machine. Default language is C/C++. The actual drawing operations are performed by the underlying windows system or accelerated graphics hardware (where available, e.g. 3Dfx, PowerVR, Intergraph, Silicon Graphics). Programmer s model: OpenGL 9

OpenGL OpenGL is interactive and dynamic and therefore we must handle interaction from the user event driven model TheGL library is the core OpenGL system: modeling, viewing, lighting, clipping The GLU library (GL Utility) simplifies common tasks: creation of common objects (e.g. spheres, quadrics) specification of standard views (e.g. perspective, orthographic) The GLUT library (GL Utility Toolkit) provides the interface with the windowing system. window management, menus, mouse interaction Skeleton Program void main() { initialise things create a screen window glutdisplayfunc(mydisplay); glutreshapefunc(myreshape); glutmousefunc(mymouse); glutkeyboardfunc(mykeyboard); perhaps initialise other things glutmainloop(); } define all callback functions 10

Creating OpenGL Applications OpenGL Conventions all function names begin with gl, glu or glut glbegin( ) glucylinder( ) glutinitdisplaymode( ) constants begin with GL_, GLU_, or GLUT_ GL_POLYGON Function names can encode parameter types, e.g. glvertex*: glvertex2i(1, 3) glvertex3f(1.0, 3.0, 2.5) glvertex4fv(array_of_4_floats) 11

Opening a Window void main(int argc,char **argv) { glutinit(&argc, argv); //initialise toolkit glutinitdisplaymode(glut_single GLUT_RGB); //set the display mode glutinitwindowsize(640,480) //set the window size glutinitwindowposition(100,150); //set the window position on screen glutcreatwindow( My First Attempt ); //open the screen window //register the callback functions glutdisplayfunc(mydisplay); glutreshapefunc(myreshape); glutmousefunc(mymouse); glutkeyboardfunc(mykeyboard); ] myinit(); //additional initialisations glutmainloop(); //go into a perpetual loop To create a red polygon with 4 vertices: OpenGL glcolor3f(1.0, 0.0, 0.0); glbegin(gl_polygon); glvertex3f(0.0, 0.0, 3.0); glvertex3f(1.0, 0.0, 3.0); glvertex3f(1.0, 1.0, 3.0); glvertex3f(0.0, 1.0, 3.0); glend(); glbegin defines a geometric primitive: GL_POINTS, GL_LINES, GL_LINE_LOOP, GL_TRIANGLES, GL_QUADS, GL_POLYGON All vertices are 3D and defined using glvertex* 12

We can use per-vertex information. To create the RG colour square: glshademodel(gl_smooth); glbegin(gl_polygon); glcolor3f(1.0, 0.0, 0.0); // Red glvertex3f(0.0, 0.0, 3.0); glcolor3f(0.0, 0.0, 0.0); // Black glvertex3f(1.0, 0.0, 3.0); glcolor3f(0.0, 1.0, 0.0); // Green glvertex3f(1.0, 1.0, 3.0); glcolor3f(1.0, 1.0, 0.0); // Yellow glvertex3f(0.0, 1.0, 3.0); glend(); OpenGL OpenGL GLUT Event Loop Interaction with the user is handled through an event loop. Application registers handlers (or callbacks) to be associated with particular events: mouse button, mouse motion, timer, resize, redraw GLUT provides a wrapper on the X-Windows or Win32 core event loop. X-Windows or Win32 manages event creation and passing, GLUT uses them to catch events and then invokes the appropriate callback. GLUT is more general than X or Win32 etc. more portable: user interface code need not be changed. less powerful: implements a common subset 13

OpenGL GLUT Event Loop 14