2

I am trying to do a texture mapping in opengl, using a cylinder as an intermediate surface, that is,

theta =(atan2(z1,x1)) + M_PI ; h = (y1); Here, x1, y1, z1 are the x,y,z of a vertex.

u = theta , v = h Here is the texture I am using

This is how the cup got textured:

Why is there a discontinuous patch in the texture map?

johnnyRose
  • 7,310
  • 17
  • 40
  • 61
Mn9
  • 85
  • 6
  • Magic 8 ball says, "Without a doubt." Not very helpful, admittedly, but it's the best I can do with what I've got to work with. Sorry. – user4581301 Mar 29 '16 at 21:53

1 Answers1

4

Why is there a discontinuous patch in the texture map?

Because you're wrapping your texture coordinates from something close to 1 back to 0. The "gap" is there, because you didn't add a gap into your geometry. You'll have to split up the geometry and add a seam where your angular texture coordinate goes to 1.

datenwolf
  • 159,371
  • 13
  • 185
  • 298