Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Input/Interaction Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Friday, September 19, 2003.

Similar presentations


Presentation on theme: "Introduction to Input/Interaction Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Friday, September 19, 2003."— Presentation transcript:

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

2 19 Sep 2003CS 3812 Review: Three Issues in 3-D CG 1. 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? 2. Hidden-Surface Removal When one object is behind another, we don’t want to see the hidden one. Then there is transparency … 3. Lighting 3-D CG is lousy without lighting. How do we do it? In addition, we want to do smooth animation.

3 19 Sep 2003CS 3813 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.

4 19 Sep 2003CS 3814 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.

5 19 Sep 2003CS 3815 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.

6 19 Sep 2003CS 3816 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).

7 19 Sep 2003CS 3817 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.

8 19 Sep 2003CS 3818 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).

9 19 Sep 2003CS 3819 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.


Download ppt "Introduction to Input/Interaction Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Friday, September 19, 2003."

Similar presentations


Ads by Google