简体   繁体   中英

cylindrical texture mapping opengl

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM