-
Notifications
You must be signed in to change notification settings - Fork 152
ReorderIBAndAdjacency
DirectXMesh |
---|
Reorders a 16-bit or 32-bit index buffer and adjacency based on a face remap array.
HRESULT ReorderIBAndAdjacency(
const uint16_t* ibin, size_t nFaces, const uint32_t* adjin,
const uint32_t* faceRemap,
uint16_t* ibout, uint32_t* adjout );
HRESULT ReorderIBAndAdjacency(
uint16_t* ib, size_t nFaces, uint32_t* adj,
const uint32_t* faceRemap );
HRESULT ReorderIBAndAdjacency(
const uint32_t* ibin, size_t nFaces, const uint32_t* adjin,
const uint32_t* faceRemap,
uint32_t* ibout, uint32_t* adjout );
HRESULT ReorderIBAndAdjacency(
uint32_t* ib, size_t nFaces, uint32_t* adj,
const uint32_t* faceRemap );
A faceRemap is an array with nFaces elements that describes how to reorder the faces of the original mesh. For each face in the optimized mesh, it provides the original location of that face (i.e. oldLoc = faceRemap[newLoc]
). See AttributeSort and OptimizeFaces.
This is the pseudo-code of how to apply a face remap.
for each j in nFaces
origFace = faceRemap[ j ]
if (origFace != -1)
for each i in 0..2
newIndices[ j*3 + i ] = indices[ origFace*3 + i ]
newAdjacency[ j*3 + i ] = adjacency[ origFace*3 + i ]
This version is used to maintain the adjacency array after a face remap. If the adjacency is not needed, use ReorderIB instead.
All content and source code for this package are subject to the terms of the MIT License.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
- Universal Windows Platform apps
- Windows desktop apps
- Windows 11
- Windows 10
- Windows 8.1
- Xbox One
- Xbox Series X|S
- Windows Subsystem for Linux
- x86
- x64
- ARM64
- Visual Studio 2022
- Visual Studio 2019 (16.11)
- clang/LLVM v12 - v18
- GCC 10.5, 11.4, 12.3
- MinGW 12.2, 13.2
- CMake 3.20
DirectX Tool Kit for DirectX 11