Thursday, August 23, 2012

What is Opengl and Qt with OpenGL.


What is opengl

OpenGL is the industry’s most widely used 2D and 3D graphics API.

OpenGL is a low level API which requires the programmer to write the exact steps needed to render a scene in a 3d space.

So it is up to the programmer to specify geometry primitives in a 3D space, apply coloring,texturing, lighting effects and render the objects onto the screen.

As OpenGL is "low-level" graphics API, An application using OpengGL must tell the computer how to draw a scene in terms of low level primitives such as vertices, lines and polygons.

For example, to draw a cube, the cube’s eight vertices must be specified.

Imagine attempting to render something as complex as a Cam-shaft using one of these low-level APIs.
As, these APIs are highly sensitive to the order in which functions are called, making direct OpenGL API call is  error prone.

So high-level APIs which support object oriented 3D visualization have been developed.
These scene graph APIs allow the programmer to define a scene and then  place objects in the scene.

For 2D visualization there is no standard for scenegraph,Qt has QGraphicsView which allows to render the 2d scenes easily using opengl.

For 3D visualization, APIs like Open Inventor and VTK are standard.

OpenGL is cross-platform, but the choice of the widget toolkit that encapsulates the OpenGL scene willl limit the  application to a particular platform.

QtOpenGL 

Role of Qt.

Qt provides the 'glue-code' required to embed an opengl rendered area into a window,With Qt Window System,QWS, the window management,handling events like widget paint event,and user input events like mouse,keyboard events.

with Qt's cross platform API it will be easier for porting the application on to  the desired platform.

Not only that any visualization application definitely requires additional APIs to print documents, parse XML, read databases, and use threads,networking, and so on and so forth.

An ideal toolkit should support all these additional utilities and be cross-platform at the same time.
Qt becomes the best choice among the other windowing tool-kits,such as Motif on the X platform, Microsoft Foundation Classes (MFC) under Windows platform,as it supports both the platforms and also many IDE's like VisualStudio,Eclipse,NetBeans.


Not only that Qt has an unique IDE Qt-Creator a versatile cross-platform complete integrated development environment available on Linux, Mac OS X and Windows operating systems.




No comments:

Post a Comment