   [RESOLVED] Load texture with lib3ds problem
  Hi, I'm a newbie in this topic but I find it very interesting!!!I'm working on the iPhone and I need to load a 3d model with a texture.I can load the geometry without any problem, but I have some issues with the textures.The texture is loaded correctly, but I see strange black lines when it's mapped, I think that this could be related to wrong uv coords.This is my code:void cmodel3ds::loadTexture(){ glGenTextures(1, &texture[0]);    glBindTexture(GL_TEXTURE_2D, texture[0]);NSString *path = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"png"];NSData *texData = [[NSData alloc] initWithContentsOfFile:path];UIImage *image = [[UIImage alloc] initWithData:texData];if (image == nil)NSLog(@"Do real error checking here");GLuint width = CGImageGetWidth(image.CGImage);GLuint height = CGImageGetHeight(image.CGImage);CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();void *imageData = malloc( height * width * 4 );CGContextRef context = CGBitmapContextCreate( imageData, width, height, 8, 4 * width, colorSpace, kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big );CGColorSpaceRelease( colorSpace );CGContextClearRect( context, CGRectMake( 0, 0, width, height ) );CGContextTranslateCTM(context, 0, height );CGContextScaleCTM(context, 1, -1);CGContextDrawImage( context, CGRectMake( 0, 0, width, height ), image.CGImage );glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, imageData);CGContextRelease(context);free(imageData);[image release];[texData release];}[/SOURCE]what is problem??Best regards[Edited by - iphonemaker on May 12, 2010 2:22:02 AM]
  I resolved my problem.Bug are inside load image of texture!!!Best regards