Results 1 to 1 of 1

Thread: Cylinder with gluCylinder()

  1. #1
    Join Date
    May 2012
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Cylinder with gluCylinder()

    Well, what i’m trying to do is to draw a Cylinder using GLUquadricObj and gluCylinder, i don’t get any code errors, compiles fine. However i don’t see the cylinder.

    Qt Code:
    1. void GLWindow::paintGL()
    2. {
    3. glClear(GL_COLOR_BUFFER_BIT);
    4. glColor3f(1,0,0);
    5. glBegin(GL_POLYGON);
    6. GLUquadricObj *obj = gluNewQuadric();
    7.  
    8. gluCylinder(obj, 1.0, 1, 3, 30, 30);
    9.  
    10. glEnd();
    11. }
    To copy to clipboard, switch view to plain text mode 

    So, the question is, how do i make the Cylinder appear at the middle of the screen?


    Added after 5 minutes:


    Fixed. I was doing: glMatrixMode(GL_MODELVIEW); and glMatrixMode(GL_PROJECTION); in resizeGL() which seems to have caused this.
    Last edited by Blastcore; 26th May 2012 at 00:12.

Similar Threads

  1. Cylinder draw using QT opengl functions
    By YuriyRusinov in forum Qt Programming
    Replies: 1
    Last Post: 25th June 2008, 23:58

Tags for this Thread

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.