Jump to content
  • Advertisement
Sign in to follow this  
JoeScie

how to see inside of an textured cylinder

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

Hello, How can I see my texture map inside an cylinder, which I have textured with an .bmp? I want to rotate the cylinder and I see only black at the ends of the cylinder:((( here is the code (based on brian paul) from the cylinder: GLuint GLTexobj::makeObject( const QImage& tex1, const QImage& tex2 ) { GLUquadricObj* q = gluNewQuadric(); GLuint cylinderObj = glGenLists(1); glNewList( cylinderObj, GL_COMPILE ); glTranslatef( 0.0, 0.0, 0.0 ); // cylinder glTexImage2D( GL_TEXTURE_2D, 0, 3, tex1.width(), tex1.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, tex1.bits() ); gluQuadricTexture( q, GL_TRUE ); gluCylinder(q, 0.6, 0.6, 2.0, 24, 1); // end cap //glTexImage2D( GL_TEXTURE_2D, 0, 3, tex2.width(), tex2.height(), 0, // GL_RGBA, GL_UNSIGNED_BYTE, tex2.bits() ); //glTranslatef( 0.0, 0.0, 2.0 ); //gluDisk( q, 0.0, 0.6, 24, 1 ); // other end cap //glTranslatef( 0.0, 0.0, -2.0 ); //gluQuadricOrientation( q, (GLenum)GLU_INSIDE ); //gluDisk( q, 0.0, 0.6, 24, 1 ); glEndList(); gluDeleteQuadric( q ); return cylinderObj; }

Share this post


Link to post
Share on other sites
Advertisement
i'm guessing it's your normals.
in order to see both sides in light, the object needs to be double sided.
with two sets of normals. i guess you could render the object once with front
face culling, then render it again with back face culling and flipped normals.

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!