Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Scrolling Map / Moving camera
Infestor last edited by
Im new to Qt and was wondering how and if it is possible to implement something like this i.e. the whole game map has size 100*100 and at any given time you only can see a part of that, but can reach any point via scrolling. So basically how any RTS map works.
Sounds like you could be interested by the graphics view framework.
8Observer8 last edited by
You can use OpenGL in Qt. Qt supports all what you need, for example, you do not need GLM for matrices, you need to use QMatrix4x4. This method allow to set a camera position: https://doc.qt.io/qt-5/qmatrix4x4.html#lookAt
I will send you my short examples for beginning in OpenGL:
- Triangle: https://rextester.com/ZTRI45421
- Texture: https://rextester.com/BJW63108
- Picking Triangle by Mouse: https://rextester.com/BBX4107
- Cube in 3D: https://rextester.com/IPI73465
You can find a lot of very good tutorials about OpenGL and use them in Qt, for example: