70

I have used a 3D iphone (.pod) model, its showing correctly in PVRShammon.

But when I imported that 3D model into isgl3D, its not showing correctly with the textured image, the image is covering only some of the areas of the object with some lines and triangles.


_cameraController = [[Isgl3dDemoCameraController alloc] initWithCamera:self.camera andView:self];
_cameraController.orbit = 10;
_cameraController.theta = 20;
_cameraController.phi = 0;
_cameraController.doubleTapEnabled = NO;


Isgl3dPODImporter * podImporter = [Isgl3dPODImporter podImporterWithFile:@"iPhone5Spod.pod"];
[podImporter printPODInfo];
[podImporter buildSceneObjects];


Isgl3dTextureMaterial *material2 = [[[Isgl3dTextureMaterial alloc] 
                                         initWithTextureFile:@"DiffuseBody2.jpg"  
                                         shininess:0.0  
                                         precision:Isgl3dTexturePrecisionHigh  
                                         repeatX:YES  
                                         repeatY:YES] autorelease];


mesh2 = [podImporter meshAtIndex:4];
node2 = [self.scene createNodeWithMesh: mesh2 andMaterial:material2];
mesh2.normalizationEnabled = YES;
node2.position = iv3(0, 0, 0);
node2.rotationY = 180;
[podImporter addMeshesToScene:self.scene];


Isgl3dLight * light  = [Isgl3dLight lightWithHexColor:@"FFFFFF" diffuseColor:@"FFFFFF" specularColor:@"FFFFFF" attenuation:0.000];
light.lightType = DirectionalLight;
[light setDirection:-1 y:-1 z:0];


[self setSceneAmbient:[Isgl3dColorUtil rgbString:[podImporter ambientColor]]];
[self schedule:@selector(tick:)];

For More Information Please have a look at the image. Output image in isgl3D view

Donald Duck
  • 8,409
  • 22
  • 75
  • 99
Infaz
  • 1,133
  • 9
  • 19
  • 1
    have you tried PVR images instead of JPEG? – slf Apr 30 '15 at 05:20
  • 1
    where are you doing your uv mapping for the texture? http://isgl3d.com/tutorials/4/tutorial_3_texture_mapping – slf Apr 30 '15 at 05:25
  • 3
    Are you sure that the object displays correctly without texture mapping (so when rendered with a isGL "non textured" material ) ? From the screenshot the problem does not looks related to texture, it more looks ike isGL3D would have a bug when loading the vertex indices from the .pod file. Have you been able to load & display other .pod files successfully with isGL3D ? – VB_overflow Aug 11 '15 at 07:44
  • 1
    Did you initialize the mesh and node objects? Also, is there a reason to only start the mesh at index 4? I'd try: [podImporter buildSceneObjects]; mesh = [podImporter meshAtIndex:0]; node = [node createNodeWithMesh: mesh andMaterial:textureMaterial2]; node.position = posVar; node.rotationY = 180; node.doubleSided = YES; – Uvar Aug 18 '15 at 09:51
  • 1
    Looking at the textures I think the vertex format is not set-up correctly in terms of number of components. The uv's are all mixed up, and the fact that only some poly's are rendering usually means that the normals of the others are flipped (and thus backface culled). This can still render something if the order and the number of float's for uv and normals are not correct, or if not all fields are consumed correctly by the shader. – StarShine Aug 26 '15 at 12:50

1 Answers1

1

This is just my two cents. Is your texture follow the isgl3D requirement?

from isgl3D Tutorial 3 - Texture mapping http://isgl3d.com/tutorials/4/tutorial_3_texture_mapping

For standard image files, the image size must be factor of two compliant: eg 64x128, 256x32, etc. For pvr textures, the image file must also be square: eg 64x64, 256x256, etc.

Hope this help.

Geeroz
  • 666
  • 7
  • 9