Jump to content
  • Advertisement
Sign in to follow this  

Distortion free texture mapping on a cone? [SOLVED]

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

This seems silly. I am trying to map a texture to a cone. Simple enough, right? Well, perhaps not. I am getting an odd distortion that I can not seem to correct. As the texture maps around the cone, I would expect pixels at the "tip" to be extremely compressed and pixels at the outer edge of the circle (if you're looking straight down on it) would be more spread out. This is, in fact, what happens. The "problem" seems to come as the left side of the texture (stretching from the tip down to the outer edge) butts up against the right side of the texture as it is mapped around. There is inconsistancy for sure. If I use a checker-board pattern, it is quite obvious that part of the texture is being obscured as the left and right edges meet. How am I doing my mapping? Glad you asked... // Begin pseudo code... GLUquadraticObj* obj = gluNewQuadradic(); // enable and bind texture with glEnable, glBind, glTexImage2D, etc. glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); glTexParameteri(GL_TEXTUER_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTUER_MIN_FILTER, GL_NEAREST); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); GLint prevMode = 0; glGetIntegerv(GL_MATRIX_MODE, &prevMode); glMatrixMode(GL_TEXTURE); glPushMatrix(); gluQuadricTexture(obj, GL_TRUE); gluQuadricTexture(obj, GLU_FILL); gluQuadricTexture(obj, GLU_SMOOTH); gluCylinder(obj, scale, 0.001f, 1.0f, 64, 1); glPopMatrix(); glMatrixMode(prevMode); // End pseudo Code Any help getting the texture to behave better would be greatly appreciated! Thanks! [Edited by - DIB on September 19, 2006 5:06:31 PM]

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!