Transcript Open GL

Overview and applications
Yasir O. Sinada
Olivier Steiger
Historical background and characteristics
• OpenGL (“Graphics Library”) was introduced in 1992 by Silicon Graphics
• Based on older IRIS GL
• Specifications governed by the OpenGL Architecture review board
(Compaq, Evans & Sutherland, Hewlett-Packard, IBM, Intel, Intergraph, Microsoft, and Silicon Graphics)
• Current version: 1.2
Characteristics:
• Platform independent: can run on consumer electronics, PC’s, workstations, etc.
• Backward compatibility required in new versions
• Supported by many hardware accelerators => fast
Architecture and terminology
Object
Model-View
Matrix
Eye
coordinates
Projection
Clip
Perspective
coordinates
Matrix
Fig.: Processing pipeline Division
Normalized
Device
coordinates
Viewport
Window
Transformation coordinates
• Model: whatever we want to render; a model is made up of primitives
• Polygon: closed, flat surface bounded by at least 3 line segments. Basic building block in OpenGL
• Vertex: corner of a polygon. Polygons are defined by their vertices (coordinates: x, y, z, w)
• Matrix transformations: allows to scale, rotate and translate vertices
• Modelview matrix: turns the raw model coordinates into coordinates as viewed from viewpoint
• Projection matrix: clips out vertices that are out of the specified viewing volume
• Perspective division: generates the normalized device coordinates using w. Usually, w=1
• Viewport transformation: 3D coordinates are turned into 2D framebuffer coordinates (=rasterization)
• Rendering: turns the model into a shaded, textured and illuminated scene
The ten OpenGL primitive types
All objects have to be made up out of these ten primitives!
Programming syntax: an example
Source code
Application: medical sciences
• Virtual endoscopy: internal examination of human body without surgery
=> painless teaching of endoscopy
Projector
• Augmented reality: combine real image with overlaid graphics
=> guiding of knife or needle during brain surgery
=> overlay of ultrasonic 3D scan and patient
• Surgical simulation:
=> data glove and head-mounted display allow
training of difficult processes without risk
Real world
• Finite element simulation of heart defibrillation:
=> allows to optimize the size and locations of the needed electrodes as well
as magnitude of defibrillation shocks
Application: medical sciences (II)
Advantages:
• Avoids unnecessary interventions
• No need for patients (rare diseases)
• Assistance for difficult procedures
Problems:
• Applications need to run in real time (10-15 frames/sec), BUT:
the model for simulation of heart defibrillation is composed of more than 1.5 million tetrahedral
elements with 250000 degrees of freedom => 4 billion floating-point ops for solution
• Resolution needed for diagnostics: 2000x2000 pixels => data sets have sizes about 13.4 GByte
Application: geology / mining
The use of 3-dimensional models allows
• Intuitive visualization of big data sets (measures)
• Impact simulation before construction
Application: industrial design
• Visualization of not yet realized prototypes, which can be located in their future context
=> potential clients get a better opinion of the product, can give feedback
• Behavior visualization: thermal graphs of airplanes, pressure distribution in mechanical structures, …
=> weak points are easily located and optimizations can be tested on virtual model
Application: special effects
• Used in motion pictures, advertisement, video games and TV industry.
• Today, this is the biggest application field for 3D graphics!
• Distinguish between “realistic” 3D (Jurassic park) and “Virtual-3D” (A bug’s life)
Application: special effects (II)
The high resolution and frame rate (especially for movies) requires powerful equipment
=> High cost for FX
Compositing is also more used than in other fields
=> many difficulties due to synchronization, color correction, realistic texturing, …
OpenGL future
Language improvements:
• often used extensions (fog coordinates, shared texture color palette, point parameters, …)
will get included into core OpenGL
• sequences of small functions get grouped into more powerful extensions
Hardware evolution:
• as hardware gets cheaper, many software functions will be included into hardware
=> speed improvement
• standard video boards support OpenGL (motivated primarily by the game industry…)
New application:
• data compression (MPEG-4)
• “Virtual reality” (3D navigation)
More information?
- Ron Fosner. “OpenGL. Programming for Windows 95 and NT.”
Addison-Wesley developpers press, 1998
- www.opengl.org: general OpenGL site
- www.sgi.com/software/opengl: some information, a lot of advertisement
- Soferman, Blythe and John. “Advanced Graphics Behind Medical Virtual Reality: Evolution of
Algorithms, Hardware and Software Interfaces.”
Proceedings of the IEEE, vol. 86, No. 3, March 1998
Class questions
• Why does OperGL provide only 10 primitives?
The conception of OpenGL goes back to 1992, when machines were slow and hardware extensions
expensive. Silicon Graphics wanted to provide a graphical language which allows the creation of any
kind of objects without requiring a too big computational amount; however, the goal was not a language
for the efficient creation of graphical objects (circles, cubes, …), which can be realized with other
software, but for scenes with lights, textures and animations.
In order to do so, they brought up ten fundamental shapes, or primitives, and associated them with many
powerful lightning and matrix operations. The primitives are just the “fundamental alphabet” allowing
the creation of complicated scenery with simple objects. More primitives would result in an increased
language complexity, slowing down the computation in certain cases.