I have been trying to import an FBX file and generate a cylinder procedurally using the following code:
int32 numberOfVertices = importedMesh->GetControlPointsCount();
int32 numberOfTriangles = importedMesh->GetPolygonCount();
int32 iteratorCount=0;
while (iteratorCount < numberOfTriangles)
{
triangles.Add(iteratorCount);
++iteratorCount;
}
iteratorCount=0;
while (iteratorCount < numberOfVertices)
{
vertices.Add(FVector(fbxVector4iterator->mData[0], fbxVector4iterator->mData[1], fbxVector4iterator->mData[2]));
vertexColors.Add(FColor(100, 100, 100, 100));
++iteratorCount;
}
mesh->CreateMeshSection(count, vertices, triangles, normals, UV0, vertexColors, tangents, false);
mesh->SetMobility(EComponentMobility::Movable);
mesh->AttachTo(RootComponent);
The normals, UV0, tangents are null TArrays.
The generated mesh looks like this:
I’m not sure why this is happening. Does anyone know where I’m going wrong?
Thanks!
