opengl l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
openGL PowerPoint Presentation
Download Presentation
openGL

Loading in 2 Seconds...

play fullscreen
1 / 26

openGL - PowerPoint PPT Presentation


  • 279 Views
  • Uploaded on

openGL. - Bipindra Bir Shrestha. Agenda. Introduction to OpenGL Demo Programming in OpenGL Demo References. What is OpenGL?. An application programmer’s interface (API) that allows programmers to write programs that access graphics hardware. Benefits .

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'openGL' - hanley


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
opengl

openGL

- Bipindra Bir Shrestha

agenda
Agenda
  • Introduction to OpenGL
  • Demo
  • Programming in OpenGL
  • Demo
  • References
what is opengl
What is OpenGL?

An application programmer’s interface (API) that allows programmers to write programs that access graphics hardware.

benefits
Benefits
  • It is close enough to hardware so that programs written with OpenGL run efficiently
  • It is easy to learn and use.
three views of opengl
Three Views of OpenGL
  • Programmer’s View
  • The OpenGL State Machine
  • The OpenGL Pipeline
the programmer s view
The programmer’s View
  • Specify Geometric Objects
  • Describing properties of these objects
  • Defining how these objects should be viewed
the opengl state machine
The OpenGL State machine

Function

Call

Pixels

opengl functions
OpenGL Functions
  • Primitive functions
    • Geometric : polygons
    • Discrete : bitmap
  • Attribute functions
    • Control attribute of primitives. Eg color, line type, light sources , textures
  • Viewing functions
    • Determine properties of Camera.
  • Input functions
    • Allow us to control windows on the screen and to use the mouse and keyboard
  • Control functions
    • Allow us to start and to terminate OpenGL programs and to turn on various OpenGL features.
opengl versions and extensions
OpenGL Versions and Extensions
  • OpenGL is controlled by OpenGL Architectural Review Board (ARB), which has members from companies such as SGI,IBM and Microsoft.
  • Present version is 2.1 . Next version 3.0, release date is not yet announced due to some issues.
  • OpenGL is very stable and has lower compatibility.
  • Extensions: allow vendors to provide additional functionality through extensions.
    • Each vendor has alphabetic abbreviation .
      • E.g: glCombinerParameterfvNV() : NV for NVDIA
    • If many vendors agree on same implementation it becomes “Standard extension” abbriviated with ARB.
      • Eg. GL_ARB_multitexture
languages
Languages
  • C
  • C#: The framework Tao for Microsoft .NET includes OpenGL between other multimedia libraries
  • Delphi: Dot[4]
  • Fortran: f90gl supports OpenGL 1.2, GLU 1.2 and GLUT 3.7 [5]
  • Java:
    • Java Bindings for OpenGL (JSR 231) and Java OpenGL (JOGL)
    • Lightweight Java Game Library (LWJGL)
  • Lisp: See the cl-opengl project at common-lisp.net
  • Perl:
    • Perl OpenGL (POGL) module - shared libs written in C
    • C vs Perl and Perl vs Python benchmarks
  • PHP: See http://phpopengl.sourceforge.net/
  • Python: PyOpenGL supports GL, GLU and GLUT [8]
  • Ruby: See [9] - supports GL, GLU and GLUT
  • Smalltalk as seen in Croquet Project running on Squeak Smalltalk
  • Visual Basic: ActiveX Control
configuring visual studio 2005
Configuring Visual Studio 2005
  • Download GLUT binaries for windows from “Nate Robins” ‘s website http://www.xmission.com/~nate/glut.html
  • put the files as
  • Make sure visual studio c++ projects links in the GLUT/gl/glu libraries. Goto: Menu: “Project -> (your-project-name) Properties” Tab: “Configuration Properties -> Linker -> Input” Under “Additional Dependencies”, add “glut32.lib opengl32.lib glu32.lib”

Under Configuration Properties->C++->General->Additional Include Directories : add "C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\Include"

programming in opengl 1
Programming in OpenGL -1
  • GLUT
    • Initialize :
      • void glutInit( int argc, char ** argv)
    • Creating a window
      • int glutCreateWindow(char * title)
    • Display Function
      • void glutDisplayFunc(void (*func)(void))
    • Main Loop
      • void glutMainLoop()
programming in opengl 2
Programming in OpenGL -2
  • Drawing a rectangle
    • glBegin(Glenum mode)
    • glEnd()
    • void glVertex{2 3 4}{sifd}(Type xcoordinate,……)
    • void glClear(Glbitfield mask)
    • void glFlush()
  • Changing GLUT defaults
    • void glutInitDisplayMode(unsigned int mode)
    • void glutInitWindowSize(intwidth,int height)
    • void glutInitWindowPosition( int x, int y)
programming in opengl 3
Programming in OpenGL -3
  • Setting Colors
    • void glColor*()
    • void glClearColor( Glclampf r, GLClampf g, Glclampf b, Glclampf a )
  • Two Dimensional Viewing
    • void gluOrtho2D( Gldouble left, Gldouble right, Gldouble bottom, Gldouble top)
  • Coordinate Systems and Transformation
    • glMatrixMode( GL_PROJECTION );
    • glLoadIdentity();
  • Points
    • glPointSize(2.0);
  • Lines
    • GL_POINTS, GL_LINES, GL_LINE_STRIP, GL_LINE_LOOP

in glBegin( GL_LINES );

  • Enabling OpenGL features
    • void glEnable( Glenum feature)
    • void glDisable( Glenum feature )
programming in opengl 4
Programming in OpenGL -4
  • Rectangles
    • void glRect{ sifd} ( TYPE x1,y1,x2,y2 )
  • Text
    • void glutBitMapCharcter( void * font, int char )
  • Save the state
    • void glpushMatrix()
    • void glPopMatrix()
  • Viewport
    • void glViewport( Glint x, GLint y, Glsizei w, Glsizei h )
interaction and animation
Interaction and animation
  • Reshape and Idle Callback
  • Double buffering
  • Using keyboard and mouse
  • Mouse motion
  • Subwindows and Multiple Windows
three dimensional programming
Three-Dimensional Programming
  • Cameras and Objects
  • Orthographic Projections in OpenGL
  • Vertex Arrays
  • Hidden Surface removal
  • GLUT Objects
transformation
Transformation
  • Translation
  • Rotation
  • Scaling
  • Setting vertices directly
lights and materials
Lights and Materials
  • Enabling and disabling OpenGL lighting
  • Specifying Light source
  • Controlling the Lighting Calculation
  • Smooth Shading
  • Transparency
images
Images
  • Pixels and Bitmaps
  • Displaying a bitmap
  • Mixing Bitmaps and Geometry
  • Colors and Masks
  • Drawing Modes
  • Reading and Writing Pixels
  • Selecting Buffers
  • Luminance
  • Pixel Zoom
texture mapping
Texture Mapping
  • Texture Coordinates
  • Texture Parameters
  • Applying textures to surface
  • Minimaps
curves and surfaces
Curves and surfaces
  • Bezier Curves and surfaces
  • One dimensional OpenGL evaluators for Bezier Curves
  • Two dimensional evaluators to evaluate Bernstein polynomials and to form Bezier surfaces.
resources
Resources
  • Official Website : http://www.opengl.org/
  • SDK : http://www.opengl.org/sdk/
  • Reference pages : http://www.opengl.org/sdk/docs/man/
  • GLUT : http://www.opengl.org/resources/libraries/glut/
  • Sample Projects at :http://www.ziyoo.com/