qt-interest@trolltech.com
[Top] [All Lists]

Re: Cylinder draw using QT opengl functions

Subject: Re: Cylinder draw using QT opengl functions
From: "Yuriy Rusinov"
Date: Mon, 16 Jun 2008 17:48:28 +0400
Hello, Enrico, All !

 void GLWidget :: paintGL (void)
 {
    glClear( GL_COLOR_BUFFER_BIT );
    glMatrixMode (GL_MODELVIEW); // should be already in GL_MODELVIEW..
    glColor3d (1, 0, 0);
    GLUquadricObj* q = gluNewQuadric ();
    GLUnurbsObj* nobs = gluNewNurbsRenderer ();
    gluBeginSurface (nobs);
    gluCylinder (q, (GLdouble)cyl_radius, (GLdouble)cyl_radius, (GLdouble)cyl_height, 32, 32);
    gluEndSurface (nobs);
    gluDeleteNurbsRenderer (nobs);
    gluDeleteQuadric (q);
 }

Good luck with your GFX programs, and enjoy OpenGL programming ;-)
Also take the time, after experimenting a bit more, to read the first
pages of the OpenGL specifications that will teach you how the graphics
pipeline is modeled in OpenGL.
 
I am sorry, but after changes my program draws nothing. Now I read opengl documentation and make new attempt to draw. Thanks in advance.

--
Best regards,
Sincerely yours,
Yuriy Rusinov
<Prev in Thread] Current Thread [Next in Thread>