PDA

View Full Version : Texture Mapping Problem



Flotonic
06-09-2013, 04:15 PM
The texture is mapping oddly to the cube in OpenGL, but it looks just fine in the OBJ format. The U/V Coordinates are identical, I think. Do U/V Coordinates have to be formatted a little differently for OpenGL than for OBJ files?

1053

Here is the source code:
http://www.maco64.com/f/Cube_Texture_Problem.c

Here is the OBJ version:
http://www.maco64.com/f/Cube.obj
http://www.maco64.com/f/mtl.mtl

Here is the texture that is used by both:
http://www.maco64.com/f/texture2.bmp

tonyo_au
06-11-2013, 02:33 AM
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
try GL_REPEAT not GL_CLAMP. Clamp clamps to range 0-1 but your UV range from -0.5 - +0.5