-
Unity mesh网格编程 —— 正二十面体
资源描述
Mesh网格编程步骤:
一:确定数量
确定该几何图形应有多少个三角形面,顶点坐标、顶点序列、UV贴图、法线向量皆为三角形面数的三倍。
二:根据三角形面确定顶点坐标
这里我习惯把一个面的顶点确定好之后再去找下一个面,这样做可以是法线和顶点序列确定起来很容易。但是要注意的是在确定顶点时要按照顺时针顺序确定,否则会导致三角形面相反。
三:确定法线
法线大致分为两种:
其一是棱角分明的几何体,这种几何体的法线可以用确定好的顶点坐标两两相减,得到的向量做叉乘并赋值给三个顶点上的法线。
其二是圆滑的几何体,这种几何体需要求出该点在曲面上的切线,从而确定垂直于切线的法线。如果是圆形。可以使用顶点减圆心所得的向量。
此外,求得的法线尽量单位化,否则可能出现一个面上的颜色不同。
四:确定顶点序列
若三角形顶点按照面数去确定,顶点序列就会变得非常简单,按顺序赋值即可。
五:确定UV贴图
根据所做几何体的不同,贴图左边也会有所改变,并不固定。
六:创建网格
- 2023-01-07 21:20:03下载
- 积分:1
-
dianzizhong
利用C-C++语言编程,实现电子钟的整点报时(从离整点的前9秒开始),并伴随音乐声(The use of C-C++ language programming, electronic bell the whole point of time (from the point from the whole nine seconds before the start), and accompanied by music)
- 2009-06-15 08:47:07下载
- 积分:1
-
Cpu卡操作的基本方法指令
读写CPU卡用到的一些命令,用于软件的操作,方便广大爱好者学习.(Some commands used to read and write CPU cards are used for software operation to facilitate the learning of enthusiasts.)
- 2018-09-15 18:34:01下载
- 积分:1
-
libpangowin32-1.0-0
yetretytryer ytryer5yetye rtyt4ye54
- 2017-12-12 04:33:06下载
- 积分:1
-
TCP
这是TCPIp的服务器程序段,可以建立服务器,实现通讯(This is the TCP Ip server block, you can create server to achieve communication)
- 2013-09-22 15:01:10下载
- 积分:1
-
test
C51单片机8位LED左移显示变化数字实验例程(C51 single-chip 8-bit LED digital test routines left show changes)
- 2013-12-19 21:22:21下载
- 积分:1
-
FillPolygon
MFC 实现多边形的填充,填充颜色可以调整(MFC to achieve polygon fill, transparent settings)
- 2021-01-14 00:18:47下载
- 积分:1
-
AD9954测试程序,单片机为stm32f103 REVG320
AD9954测试程序,单片机为stm32f103(the code to test for AD9954)
- 2017-07-25 17:36:56下载
- 积分:1
-
Advanced-Topics-in-C
Advanced Topics In C teaches concepts that any budding programmer should know. You ll delve into topics such as sorting, searching, merging, recursion, random numbers and simulation, among others. Increase the range of problems you can solve by manipulating versatile and popular data structures such as binary trees and hash tables.
- 2013-12-09 23:11:13下载
- 积分:1
-
VS2008和Access的数据库连接及操作完整示例
连接access数据库实例,简单的操作access数据库(Connecting access database instance)
- 2018-08-13 10:14:55下载
- 积分:1