QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

楼主: yuzukyo

计算机图形学与Blender阅读/翻译计划

[复制链接]
 楼主| 发表于 2006-3-12 23:02:40 | 显示全部楼层
http://bbs.blendercn.org/viewtopic.php?t=237
[quote:e9f92533a4="xlvector"]Mesh的结构定义如下:
[code:1]
typedef struct Mesh {
        ID id;

        struct BoundBox *bb;

        ListBase effect;
        ListBase disp;
       
        struct Ipo *ipo;
        struct Key *key;
        struct Material **mat;

        void *mface, *dface, *tface;
        struct MVert *mvert;
        struct MEdge *medge;
        struct MDeformVert *dvert;        /* __NLA */
        struct MCol *mcol;
        struct MSticky *msticky;
        struct Mesh *texcomesh;
        float *orco;

                /* 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;

        int totvert, totedge, totface;
        int texflag;
       
        float loc[3];
        float size[3];
        float rot[3];
       
        float cubemapsize, pad;

        short smoothresh, flag;

        short subdiv, subdivr;
        short totcol;
        short subsurftype;

} Mesh;[/code:1]

这个定义在DNA_mesh_types.h中,这个Mesh的定义和我们正常定义差不多,其中,顶点的定义在DNA_meshdata_type.h中,一般在VS的工程中找不到这个文件,需要自己在makesdna文件夹下找一下,其定义如下:
[code:1]
typedef struct MFace {
        unsigned int v1, v2, v3, v4;
        char puno, mat_nr;
        char edcode, flag;
} MFace;

typedef struct MEdge {
        unsigned int v1, v2;
        char crease, pad;
        short flag;
} MEdge;

typedef struct MDeformWeight {
        int                                def_nr;
        float                        weight;
        struct Bone                *data;                /* Runtime: Does not need to be valid in file */
} MDeformWeight;

typedef struct MDeformVert {
        struct MDeformWeight *dw;
        int totweight;
        int reserved1;
} MDeformVert;

typedef struct MVert {
        float        co[3];
        short        no[3];
        char flag, mat_nr;
} MVert;

typedef struct MCol {
        char a, r, g, b;
} MCol;

typedef struct MSticky {
        float co[2];
} MSticky;[/code:1][/quote]

[quote:e9f92533a4="xlvector"]这是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;[/quote]
回复

使用道具 举报

发表于 2006-3-13 14:24:04 | 显示全部楼层
问个闲问题

Blender是使用Mesa来做后台渲染的?
回复

使用道具 举报

 楼主| 发表于 2006-3-13 20:49:15 | 显示全部楼层
实时渲染是 opengl 1.3
当然mesa也可以,兼容的。
回复

使用道具 举报

发表于 2006-3-14 14:56:24 | 显示全部楼层
[quote:28d1706fb0="yuzukyo"]实时渲染是 opengl 1.3
当然mesa也可以,兼容的。[/quote]

opengl1.3是个标准,我是问Blender底下用的那个
OpenGL实现。
回复

使用道具 举报

 楼主| 发表于 2006-3-17 20:22:12 | 显示全部楼层
lin下当然是mesa.
blender有自己的glut实现,叫ghost,可以单独使用。
回复

使用道具 举报

 楼主| 发表于 2006-5-4 23:15:14 | 显示全部楼层

google夏日代码,半边结构(half edge)n-go

Proposal For a Half-Edge Implementation in Blender
在Blender中实现半边结构(half-edge)的建议

Introduction
The half-edge mesh structure is a manifold boundary representation, useful for writing tools that rely on quick adjacency queries and a uniform orientation. This structure can be used to write retopolizing tools, advanced beveling tools (including vertex/edge extrude), an efficient mesh decimator, and a more efficient CSG implementation.
介绍,
半边网格结构是一个多能的边界表示法,在编写快速边界邻接查询和统一定位方面的工具非常有用。
这种结构对编写重拓扑工具,高级bevel工具(点/边挤压),有效的网格优化,更有效的csg实现。
This proposal is for the addition of a half-edge utility to Blender. During initial development, it will be a separate object type, but the goal is to achieve a level of integration where a normal mesh could convert to/from a half-edge mesh as needed, to provide support for high-level tools. The current fgon support of Mesh would be utilized for this.
这篇建议是对blender半边工具的额外附加支持。经过了最初的开发阶段后,它已经成为一类单独的物体类型,但是我们想要达到目标是,在需要的情况下,可以将普通的网格同半边网格互换,为更高层次的工具实现提供支持。现在的网格fgon可以通过这样实现。

Advantages of Half-Edge
The half-edge data structure stores explicitly-orientated mesh geometry. The structure allows extremely fast adjacency queries to be carried out, making many high-level modeling tools (such as vertex/edge extrude and beveling) both easier to write and fast to run. Queries on edges surrounding a vertex, faces adjacent to a face, and others are all done in real and constant time.

半边的优点
半边结构存储了非常明确的朝向信息在网格几何体中。可以实现非常快的邻接查询,从而发展出一些高级的建模工具(比如点/边的挤压和倒角)很容易的写出他们,而且运行也相当迅速。包围一个顶点的边的查询,面面相临,所有这些都能够实时的完成耗时也只是常数时间。

User Impact
From a user point of view, fgons would become more important. Various modeling tools would now be fgon-aware, including beveling, extruding, and even (possibly) subdivision.

The most visible and important changes, though, would be addition of several highly useful mesh tools, including:

Face/Vertex/Edge beveling and extrusion tools, most of which cannot be implemented using the normal mesh structure.
Collapse vertex tool (collapse edge/face could be recoded to work with the half-edge implementation).
Ngon/fgon-aware mesh tools.
However, other changes might be substantially-improved boolean and decimate tools, along with the possibility to write a retopolizing tool as used in silo.

对用户的好处
从用户的角度,fgons变得越来越重要。很多的建模工具都开始变得fgons化了。包括倒角,挤压,甚至(可以实现的)细分。
更实际和更重要的改变就是很多高级的非常有用的工具可以做出来:
面/点/边 倒角和挤出工具,这些基本上是在普通的网格结构上不能实现的。
坍塌点工具(坍塌边/面工具会在半边结构实现后重写代码)
多边形/伪多边形网格工具
更多,可以更充分的增强布尔工具和优化工具,如果按照在silo里面实现的那种retopolizing工具做出来的话。

Details of Supported Half-Edge Features
半边实现的细节

Basic Information
Basic half-edge only supports closed and fully manifold meshes. The proposed implementation will support the open mesh and vertex-hole (also called incident vertices) extensions of half-edge, along with support for multiple shells. The term vertex-hole refers to the situation where two mesh solids are joined by one vertex (imagine two pyramids, one upside down, joined by their tips). This implementation will support query operations for iterating over the mesh solids surrounding a vertex. It will use the circular vertex method to "unglue," or separate, solids connected this way (but will hide this from both a tool and user point of view).

There will also be support for "ghost" boundary edges, which will allow circulators (iterators that operate on circular linked lists) to be used for virtually every query operation.

Note that this implementation will not support edges that share more then two faces, and as such invalid meshes will only have access to the normal mesh structure's user tools.

Euler Validation
欧拉验证
This half-edge implementation will support validation of the underlying mesh structure using the Euler-Poincaré formula. The validation system will automatically detect half-edge mesh corruption, and revert the mesh to a previous state (using a backup that will be automatically created before any user tool is executed).


就是要验证这个公式:V - E + F - (L - F) - 2(S - G) = 0
Coding Goals
The specific goals of this project are:

Achieve a stable half-edge implementation, with full support for boundary edges, vertex-holes (also known as incident vertices), and multiple shells/meshes.
Have full support for converting to/from a normal mesh structure, including awareness of fgons.
Have a fully-working euler validation system.
Implement a full set of mesh tools, including a set of extrude tools, a subdivide tool, and a set of collapse tools.
Implement a full query system, based on circulators (this includes edge and face loops).
Implement a full set of Euler operators, including collapse-vertex, collapse-face, collapse-edge, split-vertex, split-edge, and split-face.
Retrieved from "http://mediawiki.blender.org/index.php/User:Joeedh/Hemesh_SOC_Proposal"
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-2 16:40 , Processed in 0.037997 second(s), 13 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表