3 UVAtlasComputeIMTFromPerVertexSignal
Chuck Walbourn редактировал(а) эту страницу 2022-01-20 17:45:00 -08:00
UVAtlas

Calculate per-triangle IMT's from per-vertex data, to be used as input to UVAtlasCreate or UVAtlasPartition. This function allows you to calculate the IMT based off of any value in a mesh (color, normal, etc.).

HRESULT UVAtlasComputeIMTFromPerVertexSignal(
    const XMFLOAT3* positions, size_t nVerts,
    const void* indices, DXGI_FORMAT indexFormat, size_t nFaces,
    const float *pVertexSignal,
    size_t signalDimension, size_t signalStride,
    std::function<HRESULT(float percentComplete)> statusCallBack,
    float* pIMTArray);

Parameters

pVertexSignal: A float array of size signalStride * nVerts.

signalDimension: How many floats per vertex to use in calculating the IMT.

signalStride: The number of bytes per vertex in the vertex signal array. This must be a multiple of sizeof(float).

pIMTArray: The resulting IMT data which is passed to UVAtlasCreate or UVAtlasPack which is an array of 3 float values per face.