As part of the VIG (Graphical Visualization and Interaction) course I took this semester, we had to develop an application using Qt and OpenGL to practice the concepts learned through the semester. The application loads several 3D Studio models using lib3ds, renders them using OpenGL and lets the user control its behavior through a Qt interface. We have handed it in a few minutes ago; finally! :-)
The goal of the application is to show a scenario with up to ten cars moving on top of its surface in circles. These cars may optionally have a driver that automatically looks to the closest car in front of them. You can freely inspect the rendered scene (zoom, pan and free movement) using the mouse. You can also adjust several lights and other parameters.
Overall, doing this little application has been quite interesting, specially because I was OpenGL-clueless before starting the course and the results are impressive (to my point of view, that is). As regards the code, I mainly focused on the Qt interface while my partner worked more on the rendering code.
After having spent many hours in Qt Designer and dealing with the library, I can say that it is very complete and lets you write code extremely quickly. The signals and slots mechanism is very powerful and it becomes specially useful when working in the IDE. If you spend some time extending the predefined widgets to suit your needs, creating a new interface is really easy: just put the pieces where you want them, lay them out and connect the appropriate signals!
It is also true that it is very easy to create crappy code. I have to admit that our application is very hackish in some places... but there was no time to fix them to be better. This is mostly because it was not designed beforehand (we did not know all the requirements until a late date) and because of the learning-as-you-do with Qt Designer. It'd certainly be much better if we started it all over again.
Now some screenshots for your pleasure :-)
First of all, a simple scenario with a single light:
The same scenario with a darker light but with a car's lights turned on:
The previous scenario but tracking a car's movement from its inside:
The car configuration dialog:
The lights configuration dialog:
There are some more dialogs and features, but oh well, the application itself is useless ;-)
Want more posts like this one? Take a moment to subscribe!
Enjoyed this article? Spread the word or join the ongoing discussion!