Results 1 to 6 of 6

Thread: I want to draw an object in OpenGl but it draws strange thing

  1. #1
    Join Date
    Feb 2008
    Posts
    36
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default I want to draw an object in OpenGl but it draws strange thing

    Hi, I want to draw objects in OpenGl. but It draws strange things. I think that It draws from buffer .I put my cpp ve h files . do you know What the problem is..
    Attached Files Attached Files

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: I want to draw an object in OpenGl but it draws strange thing

    What do you mean by "strange things"?

  3. #3
    Join Date
    Feb 2008
    Posts
    36
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: I want to draw an object in OpenGl but it draws strange thing

    It draws a shape from buffer so different shape is created

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: I want to draw an object in OpenGl but it draws strange thing

    But your "grafik" class is not even a QGLWidget...

  5. #5
    Join Date
    Feb 2008
    Posts
    36
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: I want to draw an object in OpenGl but it draws strange thing

    I can not understand can you explain it.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: I want to draw an object in OpenGl but it draws strange thing

    The widget has to be a subclass of QGLWidget to be able to use OpenGL. Your class is derived from QMainWindow and not QGLWidget so the methods related to painting using OpenGL are never called.

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.