+ Reply to Thread
Results 1 to 5 of 5

Thread: OpenGL

  1. #1
    Join Date
    Dec 2017
    Posts
    3
    Qt products
    Qt5
    Platforms
    Windows

    Default OpenGL

    I'm new to Qt, and I'd like to learn about opengl to do a 3d plotting for my project. I tried following the tutorial online, but somehow there are errors to my code. I couldn't figure out what's wrong with it since I'm pretty new to Qt. I know that there are some examples online on opengl, but those aren't really helpful to me. Can anyone point me to a place on where to start learning about opengl in qt? It'll also help if there is an opengl example code.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,621
    Thanks
    21
    Thanked 405 Times in 399 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: OpenGL

    If you are new both to Qt and OpenGL I'd suggest you start with OpenGL first with not connection to Qt.
    Once you are proficient with OpneGL look at the specifics of using it with Qt.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
    Watch these videos, and read his books they are must if you want to write clean code:
    https://sites.google.com/site/unclebobconsultingllc/

    Recommended off-line reading Qt:
    The Foundations of Qt Development (ISBN: 1-59059-831-8)

  3. #3
    Join Date
    Dec 2017
    Posts
    3
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: OpenGL

    Thank you. I'll take a look at that. Also, I tried to follow the code again for the opengl, and I got this error on gluPerspective. I searched the internet for the solution, and most people suggest to add LIBS -lGLU and #include <GL/glut.h>. However, this method does not work for me. Do you have any idea why or how to solve the problem?

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,621
    Thanks
    21
    Thanked 405 Times in 399 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: OpenGL

    Please understand that most of us are not telepaths or remote viewers.
    Saying you have some errors is saying nothing.
    Post the code, and the resulting errors, then, maybe, we might help you.
    But again, even if we can, it will only hold until the next error you get.
    This is not way to work - you need to learn first.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
    Watch these videos, and read his books they are must if you want to write clean code:
    https://sites.google.com/site/unclebobconsultingllc/

    Recommended off-line reading Qt:
    The Foundations of Qt Development (ISBN: 1-59059-831-8)

  5. #5
    Join Date
    Aug 2008
    Location
    Algarve, Portugal
    Posts
    283
    Thanks
    22
    Thanked 30 Times in 26 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: OpenGL

    Hi

    I have this Qt OpenGL tutorials, I'm trying to make them very newbie friendly with lots of comments https://bitbucket.org/joaodeusmorgado/opengltutorials check them out if you find them usefull.

    You really dont need to use gluPerspective, that's not part of Opengl library, its part of glut libray, a helper library with math functions and others to use with OpenGL. AFAIK glut is deprecated. Since you're using Qt, you have all the helper functions you need, replace gluPerspective with QMatrix4x4:erspective(...).

    That's the beauty of using Qt, you will hardly need any other helper libraries, Qt got you covered for almost all libraries you will need, like matrix and image manipulation.

    If you're serious about learning OpenGL, I would recomend starting with Anton Gerlan book, the best book for newbies and very cheap too. A book is much better to learn than trying to figure out hard stuff like OpenGL, with lots of info all scattered around the web, imho.

    Cheers
    _______________________________________________
    Math Graphica - scientific calculator with graphs 2D / 3D / 4D, user defined functions, system of equations, formulas and integrals
    Qt Ambassador

+ Reply to Thread

Similar Threads

  1. Replies: 2
    Last Post: 5th July 2017, 14:28
  2. Conversion from opengl to opengl es2 (Shapefile rendering)?
    By swapan_gh in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 5th December 2013, 07:59
  3. converting GLUT/OpenGL to Qt/OpenGL - displaying issue
    By yoti13 in forum Qt Programming
    Replies: 1
    Last Post: 25th November 2012, 01:45
  4. Replies: 0
    Last Post: 6th December 2009, 01:41
  5. Qt with OpenGL ES for ARM9 - All OpenGL ES tests have failed!
    By vinpa in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 3rd December 2009, 11:10

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts