Skip to main content
GameDev.net gamedev.net
🔒 Locked

Create a Cylinder

Started by coba2 Jun 25, 2007 at 5:18 AM 2 replies 800+ views
Original Post
coba2
coba2
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....
CodeMunkie
CodeMunkie
gluCylinder (and the corresponding GLUT function) do not draw the caps on the cylinder. However, you can simply draw them yourself with gluDisk.
"When you die, if you get a choice between going to regular heaven or pie heaven, choose pie heaven. It might be a trick, but if it's not, mmmmmmm, boy."
How to Ask Questions the Smart Way.
coba2
coba2
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
janci123
janci123
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();

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.