Jump to content
  • Advertisement
Sign in to follow this  
mrMatrix

Assimp inconsistent triangulated data near joints

This topic is 543 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a semi-working assimp implementation for ANIMATION after I've rigged and bound. By semi-working I mean that in order to get FBX to work correctly in Maya under Skin->Bind->DropoffRate I have to put 50 - 100 otherwise the WHOLE mesh rotates. No scaling or setting of scale on the FBX solves this. Thus, I cant use dropOffRates that are reasonable and I always get a hard rotate. Not only that but I get weird triangulated data such as normals and UVs near joints. However, following OGLdev article 38 it animates correctly. Does anyone have any idea on what I could be doing wrong? Attached is my import code and pic of the problem.

 

 

34yo8lc.jpg

 

 

 

void Object::VBOup_assimp_anim(uint meshIdx, aiMesh *myMesh, aiNode *myNode)
{
auto obj = make_shared<Object>(myAbj);
obj->type = "OBJ";
obj->rename(myNode->mName.data);
//obj->rename("test");
cout << "obj->name->val_s = " << obj->name->val_s << endl;
myAbj.assimpNames.push_back(obj->name->val_s);
obj->assimpSceneParent = myAbj.myAssimpSceneName;

cout << "name / obj->assimpSceneParent = " << myNode->mName.data << " / " << obj->assimpSceneParent << endl;
cout << "name / num verts = " << myNode->mName.data << " ... " << myMesh->mNumVertices << endl;

for (unsigned int i = 0; i < myMesh->mNumVertices; ++i)
{
glm::vec2 vector2;
glm::vec3 vector;


vector.x = myMesh->mVertices[i].x;
vector.y = myMesh->mVertices[i].y;
vector.z = myMesh->mVertices[i].z;
obj->pE.push_back(vector);

vector.x = myMesh->mNormals[i].x;
vector.y = myMesh->mNormals[i].y;
vector.z = myMesh->mNormals[i].z;
obj->nE.push_back(vector);

if (myMesh->mTextureCoords[0])
{
vector2.x = myMesh->mTextureCoords[0][i].x;
vector2.y = myMesh->mTextureCoords[0][i].y;
}

else
vector2 = glm::vec2(0.f);

obj->uvE.push_back(vector2);

vector.x = myMesh->mTangents[i].x;
vector.y = myMesh->mTangents[i].y;
vector.z = myMesh->mTangents[i].z;
obj->tE.push_back(vector);
}

for (unsigned int i = 0; i < myMesh->mNumFaces; ++i)
{
aiFace myFace = myMesh->mFaces[i];

for (unsigned int j = 0; j < myFace.mNumIndices; ++j)
{
obj->idxE.push_back(myFace.mIndices[j]);
}
}
}

 

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!