Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17560

Texture Problem???

$
0
0

Hi, I successfully loaded data from fbx files. There's a problem of rendering model. Here's the code and ss. you'll understand the problem. Pls help me???


Mesh FBXCLoader::ProcessMesh(ID3D11Device * dev, ID3D11DeviceContext *devcon, FbxMesh * mesh)
{
	std::vector<VERTEX> meshvertices;
	ID3D11ShaderResourceView *meshtexture = nullptr;

	FbxVector4 *vertices = mesh->GetControlPoints();

	for (int j = 0; j < mesh->GetPolygonCount(); j++)
	{
		int numVertices = mesh->GetPolygonSize(j);

		FbxLayerElementArrayTemplate<FbxVector2> *uvVertices = 0;
		mesh->GetTextureUV(&amp;amp;amp;uvVertices, FbxLayerElement::eTextureDiffuse);

		for (int k = 0; k < numVertices; k++)
		{
			int controlPointIndex = mesh->GetPolygonVertex(j, k);

			CtrlPoint* currCtrlPoint = new CtrlPoint();
			XMFLOAT3 currPosition;
			currPosition.x = (float)vertices[controlPointIndex].mData[0];
			currPosition.y =(float)vertices[controlPointIndex …

Viewing all articles
Browse latest Browse all 17560

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>