Jump to content
  • Advertisement
Sign in to follow this  
coba2

Create a Cylinder

This topic is 4138 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

Friend how to create a cylinder??? If not using GL or GLUT... Because I try using glut... and the result is both side cicle in top and down are not draw... Can you help me....

Share this post


Link to post
Share on other sites
Advertisement
gluCylinder (and the corresponding GLUT function) do not draw the caps on the cylinder. However, you can simply draw them yourself with gluDisk.

Share this post


Link to post
Share on other sites
GLUDisk?? What is that??? Maybe you can give a sample code from website or ebook that i can learn..

And maybe another way to create a cylinder

Share this post


Link to post
Share on other sites
for example

{
//you have this
gluCylinder(quadric ,radius, radius, height, 10, 1);
// one circle
gluDisk(quadric, 0., radius, 10, 1);
// shift to another side of cylinder
glTranslate(0.,0.,height);
// another circle
gluDisk(quadric, 0., radius, 10, 1);
}

if you use ligh, you must render one of this disc's, that normals are in correct way (outside from object)
glPushMatrix()
glRotate(180,0.,1.,0.);
gluDisk(quadric, 0., radius, 10, 1);
glPopMatrix();

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!