Skip to content

Instantly share code, notes, and snippets.

@larryhou
larryhou / Mesh.bindposes.md
Last active May 29, 2025 09:29
Unity Mesh bindposes explanation

Unity官方文档对于Mesh.bindposes的解释比较含糊,比较难以理解其含义,在这我用人话解释下。

Mesh.bindposes是一个数组,每个元素是Matrix4x4对象,是对应骨骼初始形变的逆变换,可以消除骨骼初始的形变,这样在骨骼动画里面可以用来实时计算骨骼的形变增量,然后通过骨骼权重把对应的形变作用到顶点上。

对于这个逆变换,官方的示例看起来比较抽象

bindPoses[1] = bones[1].worldToLocalMatrix * transform.localToWorldMatrix;

要理解这行代码,可以做下简单推导

@mbinna
mbinna / effective_modern_cmake.md
Last active October 15, 2025 00:43
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft