m (Category KDE3)
|Line 53:||Line 53:|
The de facto standard for rendering 3D graphics today is OpenGL. Implementations of this specification come with Microsoft Windows, Mac OS X and XFree86 and often support the hardware acceleration features offered by modern graphics cards. OpenGL itself only deals with rendering on a specified area of the framebuffer through a GL context and does not have any interactions with the toolkit of the environment
Qt offers the widget QGLWidget which encapsulates a window with an associated GL context. Basically, you use it by subclassing it and reimplementing some methods.
In general, QGLWidget behaves just like any other widget, i.e. for example you can process mouse events as usual, resize the widget and combine it with others in a layout.
OpenGL is a relatively low-level interface for drawing 3D graphics. In the same way QCanvas gives the programmer a higher-level interface which details with objects and their properties, there are also high-level interfaces for 3D graphics. One of the most popular is Open Inventor. Originally a technology developed by SGI, there is today also the open source implementation Coin, complemented by a toolkit binding to Qt called SoQt.
The basic concept of Open Inventor is that of a scene. A scene can be loaded from disk and saved in a special format closely related to VRML. A scene consists of a collection of objects called nodes. Inventor already provides a rich collection of reusable nodes, such as cubes, cylinders and meshes, furthermore light sources, materials, cameras etc. Nodes are represented by C++ classes and can be combined and subclassed.
An introduction to Inventor can be found here (in general, you can substitute all mentions of SoXt by SoQt in this article).
Initial Author: Bernd Gehrmann