MESH
本文由博主(YinaPan)原创,转载请注明出处:http://www.cnblogs.com/YinaPan/p/Unity_meshtest.html
A class that allows creating or modifying meshes from scripts.
一个允许通过脚本来创建和修改meshes的类.
Meshes contain vertices and multiple triangle arrays. See the Procedural example project for examples of using the mesh interface.
网格(meshes)包括顶点和多个三角形数组。参考Procedural example project中的例子来使用网格的界面。
The triangle arrays are simply indices into the vertex arrays; three indices for each triangle.
三角形数组仅仅是顶点的索引数组,每个三角形包含三个索引。
For every vertex there can be a normal, two texture coordinates, color and tangent. These are optional though and can be removed at will. All vertex information is stored in separate arrays of the same size, so if your mesh has 10 vertices, you would also have 10-size arrays for normals and other attributes.
每个顶点可以有一条法线,两个纹理坐标,及颜色和切线。虽然这些是可选的,但是也可以去掉。所有的顶点信息是被储存在单独的同等规格的数组中,所以如果你的网格(mesh)有10个顶点,你同样应该有大小为10的数组来存储法线和其它属性。
There are probably 3 things you might want to use the modifyable mesh interface for:
大概有3件事情是你想要使用可修改的表格.
1. Building a mesh from scratch: should always be done in the following order: 1) assign vertices 2) assign triangles
新建立一个网格 :应该总是按照这个顺序来做:
1)为顶点数组赋值
2)为三角形数组赋值
示例:

2. Modifying vertex attributes every frame: 1) get vertices, 2) modify them, 3) assign them back to the mesh.
每帧修改定点属性
1)获取顶点数组
2)修改它们
3)把它们放回网格
示例:

3. Continously changing the mesh triangles and vertices: 1) call Clear to start fresh, 2) assign vertices and other attributes, 3) assign triangle indices.
连续的改变网格的三角形数组值和顶点值
1)使用Clean刷新
2)赋予顶点值和其他属性
3)赋予索引值
It is important to call Clear before assigning new vertices or triangles. Unity always checks the supplied triangle indices whether they don't reference out of bounds vertices. Calling Clear then assigning vertices then triangles makes sure you never have out of bounds data.
调用Clean函数在赋予新的顶点值和三角形索引值之前是非常重要的,Unity总是检查三角形的索引值,判断它们是否超出边界。调用Clear函数后,给顶点赋值,再给三角形数组赋值,以确保没有超出数组的边界。
示例:

MESH的更多相关文章
- EasyMesh - A Two-Dimensional Quality Mesh Generator
EasyMesh - A Two-Dimensional Quality Mesh Generator eryar@163.com Abstract. EasyMesh is developed by ...
- 在Unity中使用UGUI修改Mesh绘制几何图形
在商店看到这样一个例子,表示很有兴趣,他们说是用UGUI做的.我想,像这种可以随便变形的图形,我第一个就想到了网格变形. 做法1: 细心的朋友应该会发现,每个UGUI可见元素,都有一个‘Canvas ...
- Unity3D 导航网格自动寻路(Navigation Mesh)
NavMesh(导航网格)是3D游戏世界中用于实现动态物体自动寻路的一种技术,将游戏中复杂的结构组织关系简化为带有一定信息的网格,在这些网格的基础上通过一系列的计算来实现自动寻路..导航时,只需要给导 ...
- Mesh Data Structure in OpenCascade
Mesh Data Structure in OpenCascade eryar@163.com 摘要Abstract:本文对网格数据结构作简要介绍,并结合使用OpenCascade中的数据结构,将网 ...
- Mesh Algorithm in OpenCascade
Mesh Algorithm in OpenCascade eryar@163.com Abstract. Rendering a generic surface is a two steps pro ...
- Unity里的Mesh属性
----------------------------------------------------------------------------------------------- Mesh ...
- 【Unity3D】利用Shader以及更改Mesh实现2D游戏的动态阴影效果
最近看到一个非常有趣的益智小游戏,是一个盗贼进入房子偷东西的, 其实这种游戏市面上已经很多了,吸引我的是那个类似手电筒的效果, 主角走到哪里,光就到哪里,被挡住的地方还有阴影.有点类似策略游戏里的战争 ...
- Netgen mesh library : nglib
Netgen mesh library : nglib eryar@163.com 摘要Abstract:本文主是对Netgen的库nglib的用法进行介绍.主要参考资料是Netgen用户指南.最后给 ...
- 为什么带网格(mesh)的模型添加了刚体Rigidbody和MeshCollider,还是会从地板穿过去?
两个Gameobject 放置在空中, 一个是Cube,一个是茄子模型 Cube的Collider 是Box Collider , 茄汁的Collider 是mesh collider, 他们都添加了 ...
- Unity3d 制作动态Mesh且可以随地面凹凸起伏
适用情景:主角带着光环,光环用一张贴图,要贴在地面上,并且随地面凹凸起伏 //代码 using UnityEngine; using System.Collections; [RequireCompo ...
随机推荐
- android 随手记 广播通知栏 二
关于通知栏的使用: Notification及NotificationManager的使用详解 相关类: import android.app.NotificationManager; import ...
- 用 SQL 脚本读取Excel 中的sheet数量及名称
-- Get table (worksheet) or column (field) listings from an excel spreadsheet -- 设置变量 declare @linke ...
- zabbix 添加jvm监控
1. zabbix 服务端安装,监控jmx 需要--enable-java zabbix 客户端不需要 --enable-java 2.zabbix_server端安装jdk 安装jdk [root@ ...
- mysql安装2
linux下安装mysql-5.1.51.tar.gz (2010-10-27 10:59:26) 转载▼ 标签: mysql 数据库 tar.gz安装 杂谈 分类: Mysql数据库 MySQL h ...
- 用c写99乘法表
int main(int argc,char **argv){ int a; for(a=1;a<=9;a++){ int b; for(b=1;b<=a;b++){ printf(&qu ...
- Pen Editor
Pen Editor
- 【转】java中byte数组与int类型的转换(两种方式)----不错
原文网址:http://blog.csdn.net/piaojun_pj/article/details/5903009 java中byte数组与int类型的转换,在网络编程中这个算法是最基本的算法, ...
- wxsqlite3的加密模块单独编译
其实就是个编译过程,so easy,只是网上的方法各种,而且不是最新的,所以自己琢磨了. 1.从sqlite网站下载sqlite-amalgamation-xxx和sqlite-dll-win32-x ...
- Nodejs in Visual Studio Code 10.IISNode
1.开始 Nodejs in Visual Studio Code 08.IIS : http://www.cnblogs.com/mengkzhaoyun/p/5410185.html 参考此篇内容 ...
- H - Parity game-poj1733(需要离散化)
题意:给一个序列这个序列都是由0和1组成,现在随意拿出来一个序列,然后说出他的和是奇数还是偶数,因为有可能存在假话,让你判断前多少条没有假话,也就是查找第一个假话的位置-1 ///////////// ...