Blender的mesh 数据结构

这篇博客介绍了Blender中Mesh的数据结构,包括vertices、edges、faces等元素,以及与其相关的材质、纹理坐标、变形顶点组等信息。同时提到了EditMesh结构,它是Mesh的一个简化版本。详细解析了每个字段的用途,如存储顶点、边、面的数量,以及在游戏引擎中相关的物理系统处理。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

这是mail list 给我的解释,没有翻译,大家先看看:

> typedef struct Mesh {
> ID id;
id: used for storage of the Mesh struct in the library

> struct BoundBox *bb;
The boundbox of the mesh (surprise!)

> ListBase effect;
A list of effects applied to the mesh (again, surprise!)

> ListBase disp;
A list of display lists, I suppose. Not sure.

> struct Ipo *ipo;
A list of IPOs, for vertex keys, etc.

> struct Key *key;
A list of vertex keys (surprise!)

> struct Material **mat;
A list of materials applied to this mesh (surprise!)

> void *mface, *dface, *tface;
tface stores UV mapping, I think together with mface, in some way. About
dface, I'm not sure. This part is pretty chaotic from what I remember.

> struct MVert *mvert;
The vertices.

> struct MEdge *medge;
The edges.

> struct MDeformVert *dvert; /* __NLA */
This stores vertex groups.

> struct MCol *mcol;
This stores vertes colors.

> struct MSticky *msticky;
Sticky coordinates.

> struct Mesh *texcomesh;
Pointer to the mesh giving texture coordinates ("TexMesh")

> float *orco;
Used for texture mapping, storing the original texture coordinates of the
undeformed mesh - or something. Not sure, check the code for the exact
meaning.

> /* not written in file, caches derived mesh */
> struct DerivedMesh *derived;
> /* hacky place to store temporary decimated mesh */
> struct DispListMesh *decimated;
>
> struct OcInfo *oc; /* not written in file */
> void *sumohandle;

sumohandle is game-engine related and stores a handle for the physics
system.

> int totvert, totedge, totface;
Self-explanatory.

> int texflag;
Should be explained further below in the file.

> float loc[3];
> float size[3];
> float rot[3];

Stores texture space transform.

> float cubemapsize, pad;
Not sure about cubemapsize.

> short smoothresh, flag;
Not sure about smoothresh, flag is explained further below.

> short subdiv, subdivr;
Should be clear, SubSurf levels for OGL/Render.

> short totcol;
Total amount of materials on the mesh.

> short subsurftype;
>
> } Mesh;

在UIFrameWork中,用的是EditMesh数据结构,它比这个结构简单很多。关于这个结构的使用,以后会说

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值