2

I am using assimp for ios from h t tps://github.com/cfr/assimp-ios these file are exported from 3d max:

  • .obj h t t ps://drive.google.com/file/d/0B_Nuhl0WqfMjMUF5cks2YmR2Rlk/edit?usp=sharing
  • .mlt h t t ps://drive.google.com/file/d/0B_Nuhl0WqfMjMmtSSVZyYV85b3c/edit?usp=sharing

I import the file with this statement:

NSString* path = [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/unicity04_low_full2.obj"];
aiScene = aiImportFile([path cStringUsingEncoding:NSASCIIStringEncoding] ,aiProcessPreset_TargetRealtime_MaxQuality);

with no error report from aiGetErrorString() then i check imported data by logging value in

aiScene->mMeshes[n]->mNumUVComponents[0]
aiScene->mMeshes[n]->mTextureCoords[0][k].x
aiScene->mMeshes[n]->mTextureCoords[0][k].y
aiScene->mMeshes[n]->mTextureCoords[0][k].z

(where n and k is index of particular mesh and vertex)

The result is

  • mNumUVComponents[0] is 2 for all value of n
  • mTextureCoords[0][k].z is 0 for all value of n and k However
  • mTextureCoords[0][k].x, mTextureCoords[0][k].y is correct according to .obj

    for example, 1st texture coordinate for 1st object in .obj is vt -248.0264 1000.0000 50.0000 the respective logging show that:

  • mNumUVComponents[0] is 2

  • mTextureCoords[0][0].x is -248.0264

  • mTextureCoords[0][0].y is 1000.0000 mTextureCoords[0][0].z is 0

4

0 回答 0