Electronic Mechanical [Image Courtesy: Pixar] [Image Courtesy: - - PowerPoint PPT Presentation
Electronic Mechanical [Image Courtesy: Pixar] [Image Courtesy: - - PowerPoint PPT Presentation
Architectural Electronic Mechanical [Image Courtesy: Pixar] [Image Courtesy: humanproductivitylab.com Science Geometry(E+DD)projections Physics of light, color, appearance Algebra of transformations Engineering
» Architectural » Electronic » Mechanical
[Image Courtesy: Pixar]
[Image Courtesy: humanproductivitylab.com
» Science
- Geometry(E+DD)projections
- Physics of light, color, appearance
- Algebra of transformations
» Engineering
- Graphics software libraries, GUI
- Graphics processor architectures
» Art
- Color and perception
- Illustrative views
- Imaging = representing 2D images
- Imaging = representing 2D images
- Modeling = representing 3D objects
- Imaging = representing 2D images
- Modeling = representing 3D objects
- Rendering = constructing 2D images from 3D models
- Imaging = representing 2D images
- Modeling = representing 3D objects
- Rendering = constructing 2D images from 3D models
- Animation = simulating changes over time
- OpenGL is a software API to graphics hardware.
- Designed as a streamlined, hardware-independent
interface.
- Intuitive, procedural interface with ‘C/C++’ binding.
- To access the system, we have to used a library called GL.
- Omitted windowing and input to avoid window system
dependencies .
Links with window system (GLUT)
GLX for X window systems, WGL for Windows Cross-platform GUI libraries: GLUT, SDL, FLTK, QT, …
OpenGL core library (GL)
- OpenGL32 on Windows
- GL on most unix/linux systems (libGL.a)
OpenGL Utility Library (GLU)
- Provides functionality in OpenGL core but avoids having
to rewrite code
C++ with GDI * More than 400 LOC C++ with OpenGL * Less than 20 LOC
Display List Polynomial Evaluator Per Vertex Operations & Primitive Assembly Rasterization Per Fragment Operations Texture Memory
CPU
Pixel Operations Frame Buffer
int main( int argc, char ** argv){ glutInit( &argc, argv); glutCreateWindow( argv[0] ); glutDisplayFunc( display); glutMainLoop(); return 0; } void display(){ glClear( GL_COLOR_BUFFER_BIT); glBegin( GL_TRIANGLES); glVertex2f( 0, -.5); glVertex2f( -.5, .5); glVertex2f( .5, .5); glEnd(); glFlush(); }
int main( int argc, char ** argv){ glutInit( &argc, argv); glutCreateWindow( argv[0] ); glutDisplayFunc( display); glutMainLoop(); return 0; } void display(){ glClear( GL_COLOR_BUFFER_BIT); glBegin( GL_TRIANGLES); glVertex2f( 0, -.5); glVertex2f( -.5, .5); glVertex2f( .5, .5); glEnd(); glFlush(); } (0,0) (-1,1) (-1,-1) (1,1) (1,-1)
- Translate , glTranslatef( dx, dy, dz);
- Rotate, glRotatef(angle, x, y, z);
- Scale, glScalef( sx, sy, sz);