Sign in to follow this  

NVMeshMender - problems with using

This topic is 3311 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'm trying to use mesh mender to generate tangent-basis and the application crashes when using Mend function (says that vector is out of range). My code is very simple (note that I dont use any index buffer so every successive three indices point to every successive three vertices):
		std::vector<unsigned int> indices;
		std::vector<unsigned int> remap;
		std::vector<MeshMender::Vertex> verts;

		for (int t = 0; t < 3*facesNum; ++t)
		{
			indices.push_back(3*t + 0);
			indices.push_back(3*t + 1);
			indices.push_back(3*t + 2);
		}

		MeshMender::Vertex inv;

		for (int t = 0; t < 3*facesNum; ++t)
		{
			inv.pos = D3DXVECTOR3(vertices[t].position.x, vertices[t].position.y, vertices[t].position.z);
			inv.s = vertices[t].texCoord0.x;
			inv.t = vertices[t].texCoord0.y;
			verts.push_back( inv );
		}

		const float minNormalCreaseCos = 0.2f;
		const float minTangentCreaseCos = 0.2f;
		const float minBinormalCreaseCos = 0.2f;
		const float weightNormalsByArea = 0.5f;

		MeshMender mender;

		mender.Mend(verts,
		indices,
		remap,
		minNormalCreaseCos,
		minTangentCreaseCos,
		minBinormalCreaseCos,
		weightNormalsByArea,
		MeshMender::CALCULATE_NORMALS,
		MeshMender::DONT_RESPECT_SPLITS,
		MeshMender::FIX_CYLINDRICAL);

Share this post


Link to post
Share on other sites

This topic is 3311 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.

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