Download presentation
Presentation is loading. Please wait.
Published byDerek Alexander Modified over 9 years ago
1
Andy Wilson - GLUT and GLVU - 9/99 - Slide 1 GLUT and GLVU Andy Wilson September 22, 1999
2
Andy Wilson - GLUT and GLVU - 9/99 - Slide 2 Outline IntroductionIntroduction GLUTGLUT GLVUGLVU Where to learn moreWhere to learn more Questions and AnswersQuestions and Answers
3
Andy Wilson - GLUT and GLVU - 9/99 - Slide 3 Introduction: Motivation So you want to use OpenGL?So you want to use OpenGL? –Low-level commands »Manage rendering state »Render primitives The windowing system is in your wayThe windowing system is in your way No “world management” availableNo “world management” available
4
Andy Wilson - GLUT and GLVU - 9/99 - Slide 4 Introduction: GLUT GLUT: simple interface to window systemGLUT: simple interface to window system –User functions handle window events »mouse, keyboard, resize, expose… –Simple pop-up menus –A few simple shapes (sphere, cone, teapot) No concept of world or camera managementNo concept of world or camera management –You reinvent the wheel a lot.
5
Andy Wilson - GLUT and GLVU - 9/99 - Slide 5 Introduction: GLVU GLVU: object and camera managementGLVU: object and camera management –Several different model formats –Renderable objects –Easily extensible »Several modules available or under development - IBR, tracking, large models, LOD...
6
Andy Wilson - GLUT and GLVU - 9/99 - Slide 6 Outline IntroductionIntroduction GLUTGLUT GLVUGLVU Where to learn moreWhere to learn more Questions and AnswersQuestions and Answers
7
Andy Wilson - GLUT and GLVU - 9/99 - Slide 7 GLUT: System Overview User Callbacks (Display, Idle, Keyboard, Mouse, Resize, …) GLUT Window System Events (Mouse, Keyboard, Window Expose/Hide/Resize/Destroy)
8
Andy Wilson - GLUT and GLVU - 9/99 - Slide 8 GLUT: Program Structure Initialization and window/menu setupInitialization and window/menu setup Interface callbacksInterface callbacks –Handle mouse, keyboard input Display functionDisplay function –Draw world (including camera management) Idle functionIdle function –Runs when no events pending
9
Andy Wilson - GLUT and GLVU - 9/99 - Slide 9 GLUT: Interface Callbacks KeyboardKeyboard –Key press, key release, window location MouseMouse –Enter/leave window, button down/up, drag MenuMenu –Item select
10
Andy Wilson - GLUT and GLVU - 9/99 - Slide 10 GLUT: Display Callback Responsible for entire display processResponsible for entire display process –Clear buffers –Set up camera, GL matrix stacks –Draw objects (including multipass rendering) –Swap front/back buffer Good place to put per-frame world updatesGood place to put per-frame world updates –physics, collision, trackers
11
Andy Wilson - GLUT and GLVU - 9/99 - Slide 11 GLUT: Idle Callback Invoked when events not being received from window systemInvoked when events not being received from window system Typical uses:Typical uses: –request redraw (continuous update) –update simulation clock No guarantee on when it’ll be called!No guarantee on when it’ll be called!
12
Andy Wilson - GLUT and GLVU - 9/99 - Slide 12 What GLUT Doesn’t Do World and model managementWorld and model management –Load and place and render models yourself Camera managementCamera management –Manage GL projection stack yourself Motion controlMotion control –Arcball? Drive? Strafe? Look around? Multipipe anythingMultipipe anything
13
Andy Wilson - GLUT and GLVU - 9/99 - Slide 13 Outline IntroductionIntroduction GLUTGLUT GLVUGLVU Where to learn moreWhere to learn more Questions and AnswersQuestions and Answers
14
Andy Wilson - GLUT and GLVU - 9/99 - Slide 14 GLVU: Overview Object managementObject management –Several polygonal file formats supported –Objects can render themselves Camera and simple navigationCamera and simple navigation –Walk, translate, examine, look around Easily extensibleEasily extensible Sits on top of GLUTSits on top of GLUT
15
Andy Wilson - GLUT and GLVU - 9/99 - Slide 15 GLVU: System Diagram GLUT GLVU Input Handlers User Idle Func User Display Func User Input Handlers GLVU Model Formats
16
Andy Wilson - GLUT and GLVU - 9/99 - Slide 16 GLVU: System Architecture Everything is object-oriented C++Everything is object-oriented C++ Components all inherit from base classesComponents all inherit from base classes –Camera, Object Default GLUT keyboard and mouse handlers providedDefault GLUT keyboard and mouse handlers provided –User typically extends rather than replaces GLVU divided into Core and ModulesGLVU divided into Core and Modules
17
Andy Wilson - GLUT and GLVU - 9/99 - Slide 17 GLVU: Writing a Program Just like writing a GLUT program, except…Just like writing a GLUT program, except… –Load models by instantiating objects –Call Display() methods instead of rendering by hand –Motion handlers already provided
18
Andy Wilson - GLUT and GLVU - 9/99 - Slide 18 GLVU Core Perspective CameraPerspective Camera VRML, BFF, OBJ, TRI, WFF model formatsVRML, BFF, OBJ, TRI, WFF model formats Bounding boxesBounding boxes PPM images (for texture maps)PPM images (for texture maps) Vector, Matrix math libraryVector, Matrix math library Walk, Examine, Look, Translate movement modesWalk, Examine, Look, Translate movement modes
19
Andy Wilson - GLUT and GLVU - 9/99 - Slide 19 GLVU Modules IBR far-field representationsIBR far-field representations –Textured depth mesh, environment-mapped cubes, layered depth images, … Light Cameras (place lights by moving viewpoint)Light Cameras (place lights by moving viewpoint) Large Model utilities (cells, memory management)Large Model utilities (cells, memory management) See Bill Baxter (baxter@cs) for latest list and ownersSee Bill Baxter (baxter@cs) for latest list and owners
20
Andy Wilson - GLUT and GLVU - 9/99 - Slide 20 Extending GLVU New model formatsNew model formats –Just write a loader and a display method Image-based renderingImage-based rendering –Most work goes into display method –Almost anything can be cast as an Object Can always override default GLVU input handlersCan always override default GLVU input handlers –Trackers, button boxes, joysticks...
21
Andy Wilson - GLUT and GLVU - 9/99 - Slide 21 User Interface Toolkits Many available; choose your favoriteMany available; choose your favorite TCL/TkTCL/Tk –http://dev.scriptics.com GLUIGLUI –http://www.cs.unc.edu/~rademach/glui FLTKFLTK –http://www.fltk.org
22
Andy Wilson - GLUT and GLVU - 9/99 - Slide 22 Outline IntroductionIntroduction GLUTGLUT GLVUGLVU Where to learn moreWhere to learn more Questions and AnswersQuestions and Answers
23
Andy Wilson - GLUT and GLVU - 9/99 - Slide 23 Where to Learn More Read the example code!Read the example code! GLUTGLUT –http://reality.sgi.com/mjk_asd/glut3/glut3.html GLVUGLVU –Bill Baxter (baxter@cs) can tell you how to get the source
24
Andy Wilson - GLUT and GLVU - 9/99 - Slide 24 Outline IntroductionIntroduction GLUTGLUT GLVUGLVU Where to learn moreWhere to learn more Questions and AnswersQuestions and Answers
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.