Sign in to follow this  
TTK-Bandit

md5mesh loading: mesh too small, while skeleton correct..

Recommended Posts

TTK-Bandit    120
Hey, I've been writing an md5mesh importer, and weird thing is, the skeleton shows correctly, but the mesh itself is a LOT smaller.. This is how I create the verts:
	ogVec3 tVec;
	int j, num = vertexList.Num();
	for( int i=0; i<num; i++ ) {
		if ( i >= vertexList.Num() )
			return false;

		const ogMD5Vertex &md5Vert = vertexList[i];

		mesh->texCoords.Append( md5Vert.texCoord );
		ogVec3 &vert = mesh->verts.Alloc();

		for ( j=md5Vert.firstWeight; j<=md5Vert.lastWeight; j++ ) {
			if ( j >= weightList.Num() )
				return false;
			const ogMD5Weight &weight = weightList[j];

			if ( weight.jointIndex >= joints.Num() )
				return false;

			const ogVBMJoint &joint = joints[weight.jointIndex];
			joint.quat.TransformVector( weight.origin, tVec );
			vert += (tVec + joint.origin) * weight.bias;
		}
	}
	return true;
The character mesh looks absolutely correct, except that it has the size of a toe of the skeleton. any ideas what I missed ?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this