gluCylinder in OpenGL-0.54

skchan_at_cs.usask.ca
Date: 01/30/04

  • Next message: Remigisz K.: "mod_perl + mod_proxy"
    Date: 30 Jan 2004 14:51:37 -0800
    
    

    Greetings All,

    I hope someone out there is using or has used the OpenGL-0.54 module.
    I've installed it and I'm trying to use the gluCylinder function to
    draw a cylinder. The perl code below yields an empty window (no
    cylinder).

    Here's a snippet of what I have:
                                                                       
    glpOpenWindow;
    glClearColor(0,1,0,1);
    glClear(GL_COLOR_BUFFER_BIT);
    glOrtho(-1,1,-1,1,-1,1);

    glColor4f(1,0,0,1);
    my $quad = OpenGL::gluNewQuadric();
    print "quad: $quad\n";

    my $cylinder = glGenLists(100);
    print "cylinder: $cylinder\n";

    glNewList($cylinder, GL_COMPILE);
    OpenGL::gluQuadricDrawStyle($quad, GLU_FILL);

    glRotatef(45.0,0.0,1.0,0.0);
    OpenGL::gluCylinder($quad, 1,0.75,1,15,15);
    ************

    The corresponding C code draws out the cylinder for me:

    void init_scene()
    {
      GLUquadricObj *quadric;

      cylinder = glGenLists(10);

      glNewList(cylinder, GL_COMPILE);
      quadric = gluNewQuadric();
      gluQuadricDrawStyle(quadric, GLU_FILL);

      glColor3f(1, 0, 0);
      glRotatef(45.0,1.0,0.0,0.0);
      gluCylinder(quadric, 1.0, 1.0,1.0,32,32);
      gluDeleteQuadric(quadric);
      glEndList();
    }

    *****

    Hopefully, someone can give me a few pointers. Many thanks for your
    time.


  • Next message: Remigisz K.: "mod_perl + mod_proxy"

    Relevant Pages

    • how to draw cylinder between points
      ... i would like to draw a cylinder beween two coordinates. ... Calculate the cosine angle between between V and the z-axis (wich is ... float v1, v2, v3; ...
      (comp.graphics.api.opengl)
    • 3D Graphics in MFC
      ... I want to draw some simple 3D graphics in a MFC SDI Application. ... graphics consist of a cylinder, which may have multiple radius, and on that ... cylinder I want to draw Text and if possible also bitmap images. ... Please correct me so I may improve my English! ...
      (microsoft.public.vc.mfc)
    • Re: 3D Graphics in MFC
      ... I want to draw some simple 3D graphics in a MFC SDI Application. ... graphics consist of a cylinder, which may have multiple radius, and on that ... cylinder I want to draw Text and if possible also bitmap images. ...
      (microsoft.public.vc.mfc)
    • draw cylinder
      ... I would like to draw a cylinder with the two circles at ... then rotate it to the graph I want. ...
      (comp.soft-sys.matlab)