Home | Documentation | Download | Screenshots | Developer |
QGLViewer enables you to quickly develop a small test program as well as a complete 3D application. It is versatile and is not designed for any specific application. It it also very convenient as a 3D/openGL pedagogical tool.
QGLViewer
main class. All you
need to do is to overload the draw()
function, which will contain the OpenGL orders that describe
your 3D scene. You may want to read a very simple commented program to
see exactly how it works.
QGLViewer
class, and can be overloaded in your own application. Apart from the draw()
function, an
other good example is the init()
function, which can be used to initialize the openGL state
of your viewer, before the first display. Many other functions can be used as is or redefined, see
the feature list for a complete description of the available functions.
draw()
function, you are implicitly located at
the origin of the so-called world coordinate system. The camera is an "object" located in
this virtual world, that can be moved with the mouse (try to press 'A', the drawAxis() shortcut key
to see the world coordinate system). This conception is different (but much more intuitive) than the
original camera-centered openGL coordinate system.
QGLViewer
is versatile and makes no assumptions on the type of 3D application you are
developing. However, in order to implement camera()->showEntireScene()
, to set the fly speed in
walkthrough mode, to optimally set the ZNear
and ZFar
of the camera or to tune the
stereo display, you need to provide an approximation of your Scene radius, expressed in
openGL units. This is done using the setSceneRadius()
function.
init()
function:
setSceneRadius(100.0); // for instance setSceneCenter(400,0,0); // for instance camera.showEntireScene();