用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/microsoft/DirectXMesh --skill directxmesh-usage命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | directxmesh-usage |
| description | Guide for integrating the DirectXMesh geometry processing library into a C++ project. |
| license | MIT |
| metadata | {"author":"chuckw","version":"1.0"} |
This skill provides guidance for integrating the DirectXMesh geometry processing library into a C++ project.
Invoke this skill when:
DirectXMesh is a geometry processing library for Direct3D 11 and Direct3D 12 applications. It provides support for loading and saving mesh data, and performing various geometry processing operations including normal and tangent computation, adjacency generation, and mesh optimization.
directxmesh_desktop_win10, directxmesh_uwpdirectxmeshIn your vcpkg.json file, add the following:
{
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
"dependencies": [
"directxmesh"
]
}
vcpkg install directxmesh
Features: dx12 (DirectX 12 input layout support), tools (command-line tools). Triplets: x64-windows, x64-linux, arm64-windows, etc.
For DLL usage (x64-windows default triplet), define DIRECTX_MESH_IMPORT in your consuming project. For static library usage, use -static-md triplet variants.
CMakeLists.txt:
find_package(directxmesh CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE Microsoft::DirectXMesh)
Use directxmesh_desktop_win10 for Win32 desktop applications or directxmesh_uwp for UWP apps.
Add the appropriate .vcxproj from the DirectXMesh/ folder to your solution and add a project reference. Add the DirectXMesh directory to your Additional Include Directories.
#include <d3d12.h> // or <d3d11_1.h> — include BEFORE DirectXMesh.h
#include "DirectXMesh.h"
using namespace DirectX;
All functions reside in the DirectX namespace. Most functions have overloads for both 16-bit and 32-bit index buffers.
flowchart TD
A[Load geometry\npositions, indices, texcoords] --> B
B[GenerateAdjacencyAndPointReps] -->|adjacency, pointRep| C
C[Validate\noptional diagnostics] --> D
D[Clean\nfix bowties, degenerate triangles] -->|dupVerts| E
E[ComputeNormals / ComputeTangentFrame] --> F
F[AttributeSort] -->|faceRemap| G
G[OptimizeFaces] -->|faceRemap| H
H[ReorderIB\napply face remap] --> I
I[OptimizeVertices] -->|vertexRemap| J
J[FinalizeIB + FinalizeVB\napply vertex remap and dupVerts] --> K
K[CompactVB\noptional, remove trailing unused vertices] --> L
L[ComputeMeshlets] -->|"meshlets, uniqueVertexIB (uint8_t), primitiveIndices"| M
M[ComputeCullData\nfor mesh shader GPU culling]
Note:
uniqueVertexIBfromComputeMeshletsis a packed buffer ofuint16_toruint32_tindices (matching the original IB format). Reinterpret-cast it to the appropriate type forComputeCullData.
HRESULT. Check with SUCCEEDED(hr) or FAILED(hr).noexcept never throw; they return E_OUTOFMEMORY or E_INVALIDARG on failure.std::vector or std::function may throw on allocation failureDirectXMesh/DirectXMesh.h — read this for exact signatures and SAL annotations.reference/overview.md in this skill folder.Utilities/WaveFrontReader.h (OBJ file loading), Utilities/FlexibleVertexFormat.h (legacy FVF conversion).USING_DIRECTX_HEADERS.