GLUT and GLVU - PowerPoint PPT Presentation

About This Presentation
Title:

GLUT and GLVU

Description:

The windowing system is in your way. No 'world management' available ... Textured depth mesh, environment-mapped cubes, layered depth images, ... – PowerPoint PPT presentation

Number of Views:50
Avg rating:3.0/5.0
Slides: 25
Provided by: ruiba
Category:

less

Transcript and Presenter's Notes

Title: GLUT and GLVU


1
GLUT and GLVU
  • Andy Wilson
  • September 22, 1999

2
Outline
  • Introduction
  • GLUT
  • GLVU
  • Where to learn more
  • Questions and Answers

3
Introduction Motivation
  • So you want to use OpenGL?
  • Low-level commands
  • Manage rendering state
  • Render primitives
  • The windowing system is in your way
  • No world management available

4
Introduction GLUT
  • GLUT 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 management
  • You reinvent the wheel a lot.

5
Introduction GLVU
  • GLVU object and camera management
  • Several different model formats
  • Renderable objects
  • Easily extensible
  • Several modules available or under development -
    IBR, tracking, large models, LOD...

6
Outline
  • Introduction
  • GLUT
  • GLVU
  • Where to learn more
  • Questions and Answers

7
GLUT System Overview
User Callbacks (Display, Idle, Keyboard, Mouse,
Resize, )
GLUT
Window System
Events (Mouse, Keyboard, Window
Expose/Hide/Resize/Destroy)
8
GLUT Program Structure
  • Initialization and window/menu setup
  • Interface callbacks
  • Handle mouse, keyboard input
  • Display function
  • Draw world (including camera management)
  • Idle function
  • Runs when no events pending

9
GLUT Interface Callbacks
  • Keyboard
  • Key press, key release, window location
  • Mouse
  • Enter/leave window, button down/up, drag
  • Menu
  • Item select

10
GLUT Display Callback
  • Responsible 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 updates
  • physics, collision, trackers

11
GLUT Idle Callback
  • Invoked when events not being received from
    window system
  • Typical uses
  • request redraw (continuous update)
  • update simulation clock
  • No guarantee on when itll be called!

12
What GLUT Doesnt Do
  • World and model management
  • Load and place and render models yourself
  • Camera management
  • Manage GL projection stack yourself
  • Motion control
  • Arcball? Drive? Strafe? Look around?
  • Multipipe anything

13
Outline
  • Introduction
  • GLUT
  • GLVU
  • Where to learn more
  • Questions and Answers

14
GLVU Overview
  • Object management
  • Several polygonal file formats supported
  • Objects can render themselves
  • Camera and simple navigation
  • Walk, translate, examine, look around
  • Easily extensible
  • Sits on top of GLUT

15
GLVU System Diagram
User Input Handlers
GLVU Model Formats
GLVU Input Handlers
User Idle Func
User Display Func
GLUT
16
GLVU System Architecture
  • Everything is object-oriented C
  • Components all inherit from base classes
  • Camera, Object
  • Default GLUT keyboard and mouse handlers provided
  • User typically extends rather than replaces
  • GLVU divided into Core and Modules

17
GLVU Writing a Program
  • 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
GLVU Core
  • Perspective Camera
  • VRML, BFF, OBJ, TRI, WFF model formats
  • Bounding boxes
  • PPM images (for texture maps)
  • Vector, Matrix math library
  • Walk, Examine, Look, Translate movement modes

19
GLVU Modules
  • IBR far-field representations
  • Textured depth mesh, environment-mapped cubes,
    layered depth images,
  • Light Cameras (place lights by moving viewpoint)
  • Large Model utilities (cells, memory management)
  • See Bill Baxter (baxter_at_cs) for latest list and
    owners

20
Extending GLVU
  • New model formats
  • Just write a loader and a display method
  • Image-based rendering
  • Most work goes into display method
  • Almost anything can be cast as an Object
  • Can always override default GLVU input handlers
  • Trackers, button boxes, joysticks...

21
User Interface Toolkits
  • Many available choose your favorite
  • TCL/Tk
  • http//dev.scriptics.com
  • GLUI
  • http//www.cs.unc.edu/rademach/glui
  • FLTK
  • http//www.fltk.org

22
Outline
  • Introduction
  • GLUT
  • GLVU
  • Where to learn more
  • Questions and Answers

23
Where to Learn More
  • Read the example code!
  • GLUT
  • http//reality.sgi.com/mjk_asd/glut3/glut3.html
  • GLVU
  • Bill Baxter (baxter_at_cs) can tell you how to get
    the source

24
Outline
  • Introduction
  • GLUT
  • GLVU
  • Where to learn more
  • Questions and Answers
Write a Comment
User Comments (0)
About PowerShow.com