PDA

View Full Version : Qt OpenGL



cRooked
3rd November 2015, 11:33
Hey Community,

since Im new to Qt/openGL I really could need some help.

Its really hard to find proper tutorials which tell you how to work with initializeGL() and paintGL().. the only tutorials i found just hardcoded a triangle inside of paintGL().
My problem is that i want to load .obj files, writing a loader should not be a problem.
I already have a little experience with openGL and know how to draw there but I dont know how to draw with QtWidget.

Is there any proper tutorial how to use buffer and bind vertices/normals/indices and of which type?
In openGL i used Gfloat [] to store the vertices and other stuff but i could not get it working in QtGL.

so my main question is:

Where to store my data?
How to use this data in initializeGL()? -> proper binding etc
How to use this data in paintGL()? -> again binding and other stuff i need

I would really appreciate if someone could just give me a hint or a little example.


Greetings

d_stranz
3rd November 2015, 22:12
You might want to start with this tutorial (http://www.kdab.com/opengl-in-qt-5-1-part-1/) and this from the Qt examples (http://doc.qt.io/qt-5/examples-widgets-opengl.html).