Jump to content
  • Advertisement
Sign in to follow this  

OpenGL Drawing a cylinder

This topic is 4415 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, Was wondering if any of you fine people could help me with a little openGL problem. I'm pretty new to openGL so my appologies if this is a rookie-mistake :) I'm trying to draw a cylinder using gluCylinder(). However my code compiles and runs ok but the cylinder is nowhere to be seen on screen. Here's the code I'm using (a slice of it, if you need more just ask :)):
void display(void)
   GLUquadricObj *myQuad;


   myQuad = gluNewQuadric();
   gluQuadricDrawstyle(myQuad, GLU_FILL);
   glColor3f(1.0, 1.0, 0.0);
   gluCylinder(myQuad, 0.2, 0.2, 0.5, 15, 15);

Any ideas as to what I'm doing wrong? Any help is greatly appreciated :) -Dean

Share this post

Link to post
Share on other sites
If and where the cylinder appears is determined by code you haven't shown us, specifically, how you've set up the projection and modelview matrices.

Also, pushing and popping the current OpenGL matrix as you're doing has no effect; those statements should be removed. (I'll also mention that I'm not sure what the effect of deleting your quadric before flushing might be. I'm guessing that's not part of the problem, but I could be wrong.)

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!