|
An image viewer on top of OpenGL
This class provides a 3-dimensional image display area.
It allows to load multimple images and transform them independently in a 3D space as well as manipulating the space as well
.
The usage should be pretty simple. You load images and rotate, scale, move tint and fade them by your needs.
However, there's one thing in 3D in general and OpenGL in special that seems to confuse people, so i'll describe the "problem" and how it's implemented in this class.
The confusing thing is the difference between model (i.e. the images in our case) and view transformation.
I guess the main reason why people are confused by this when writing OpenGL applications is that OpenGL handles both, model and view transformations on the same Matrix stack, i.e. only the time when you make a call decides whether you influence the model or the view.
Luckily, you won't face this aspect with the KGLImageViewer class as the transformation values for the images and the view are set independently (as this is an object oriented approach ;) )
Now what is this like?
1. The class limits the OpenGL calls to what i believe makes most sense for this purpose - if you need anything beyond this, you'll have to reimplement the paintGL() function.
2. The KGLImageView implementation of OpenGL transformation calls can be viewn as a solar system: Every action happens around the sun
In the beginning you're in the center of that system, i.e. you're the sun.
You can place images like planets around you, so you'll leave the view as it is and call move() and rotate() on the images to position and turn them in space. TODO: finish this up... ;)
- Author:
- Thomas Lübking <thomas.luebking@web.de>
|