Mesh Transforms

Mesh Transforms

先上源代码
本文很简单粗暴,在 layer 中引入了一些点,然后通过移动点来改变整体的形状。

CAMeshVertex

CAMeshVertex 是相当简单的一个结构体

1
2
3
4
typedef struct CAMeshVertex {
CGPoint from;
CAPoint3D to;
} CAMeshVertex;

CAPoint3D 看上去和 CGPoint 很类似,只不过拓展了 z 轴

1
2
3
4
5
typedef struct CAPoint3D {
CGFloat x;
CGFloat y;
CGFloat z;
} CAPoint3D;

CAMeshVertex 的想法是相当简单:他描述了平面点和3D 空间的映射,

CAMeshFace

1
2
3
4
typedef struct CAMeshFace {
unsigned int indices[4];
float w[4];
} CAMeshFace;

作者

shouyi.www

发布于

2019-12-04

更新于

2025-01-30

许可协议

评论

Your browser is out-of-date!

Update your browser to view this website correctly.&npsb;Update my browser now

×