1 / 9

Introduction to Input/Interaction

Learn about key concepts in interactive 3-D computer graphics including viewing, hidden-surface removal, lighting, smooth animation, input devices, GUI programming, and the client-server model. Discover practical techniques for handling input and interaction in CG applications.

brouwer
Download Presentation

Introduction to Input/Interaction

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to Input/Interaction Glenn G. ChappellCHAPPELLG@member.ams.org U. of Alaska Fairbanks CS 381 Lecture Notes Friday, September 19, 2003

  2. Review:Three Issues in 3-D CG • Viewing and Transformations • How do we look at a scene from any point of view within the scene, looking in any direction? • How do we do perspective projection? • How do we rotate things about arbitrary axes in 3-D? • Hidden-Surface Removal • When one object is behind another, we don’t want to see the hidden one. • Then there is transparency … • Lighting • 3-D CG is lousy without lighting. How do we do it? • In addition, we want to do smooth animation. CS 381

  3. Review:Hidden-Surface Removal • Quick & Dirty Hidden-Surface Removal • Add GLUT_DEPTH to your glutInitDisplayMode call. • This allocates a depth buffer. • Remember, the various constants are bitwise-or’ed together. • Add GL_DEPTH_BUFFER_BIT to your glClear call. • This clears the depth buffer. • Again, bitwise-or. • Put glEnable(GL_DEPTH_TEST) somewhere in your initialization. • This enables hidden-surface removal. CS 381

  4. Review:Double Buffering • Smooth Animation • Use double buffering. • Change GLUT_SINGLE to GLUT_DOUBLE in your glutInitDisplayMode call. • Change glFlush to glutSwapBuffers in your display callback. • Now the user only sees completed frames. • No flicker in animation. • Faster sometimes, slower others. • User cannot see the frame being built. • Sometimes this is bad, as with some complex fractals. CS 381

  5. Input/Interaction:Overview • Our next topic is interactive GUI programming. • Input devices. • The client/server model. • … and how it facilitates various types of I/O. • Event-driven programming with the mouse. • Including “picking”. • Widgets. • Buttons, etc. CS 381

  6. Input/Interaction:Input Devices & GUI’s • Modern GUI’s typically make strong assumptions about the I/O available to the user: • A keyboard and mouse (or other pointing device) are available. • The output is a (color?) raster display that can refresh the image in a fraction of a second. • As opposed to a printer, which typically has refresh times on the order of several seconds or more. • I/O is interactive, so that output is seen immediately by the user, who can respond with more input with little delay. • Input and output are tied together (so that the mouse position corresponds to a screen position, for example). CS 381

  7. Input/Interaction:Client-Server Model [1/3] • Many operations in a computing environment, especially in a networked environment, are provided via a client-server model. • The server sits and waits for requests. • A client can request the server to provide services. • If the request is valid, the server provides the services to the client. • Example • A web server serves web pages to clients. • In this situation, the client is: the browser. CS 381

  8. Input/Interaction:Client-Server Model [2/3] • The client-server model applies to CG as well. • We have a program that wants to create and display CG output on the user’s desktop machine. • Client: Application program. • Server: Graphics hardware. • This arrangement sometimes looks backwards (to me, anyway). CS 381

  9. Input/Interaction:Client-Server Model [3/3] • The client-server model affects optimization. • Typically the greatest bottleneck is in the communication between the client and the server. • So we want to minimize such communication. • Thus we want to concentrate large operations on the client side or the server side. CS 381

More Related