当前位置: 首页 > news >正文

个人网站建设实验心得软件开发培训机构去哪个学校

个人网站建设实验心得,软件开发培训机构去哪个学校,php网站打开慢,wordpress多站点无css推荐:将 NSDT场景编辑器 加入你3D工具链 其他工具系列: NSDT简石数字孪生 顶点索引复用顶点数据 通过几何体BufferGeometry的顶点索引属性BufferGeometry.index可以设置几何体顶点索引数据,如果你有WebGL基础很容易理解顶点索引的概念&#…
推荐:将 NSDT场景编辑器 加入你3D工具链
其他工具系列: NSDT简石数字孪生

顶点索引复用顶点数据

通过几何体BufferGeometry的顶点索引属性BufferGeometry.index可以设置几何体顶点索引数据,如果你有WebGL基础很容易理解顶点索引的概念,如果没有也没有关系,下面会通过一个简单的例子形象说明。

比如绘制一个矩形网格模型,至少需要两个三角形拼接而成,两个三角形,每个三角形有三个顶点,也就是说需要定义6个顶点位置数据。对于矩形网格模型而言,两个三角形有两个顶点位置是重合的。也就是说可以重复的位置可以定义一次,然后通过通过顶点数组的索引值获取这些顶点位置数据。

不使用顶点索引

下面通过几何体六个顶点定义了两个三角形,几何体的顶点位置数据、顶点法向量数据都是6个。

var geometry = new THREE.BufferGeometry(); //声明一个空几何体对象
//类型数组创建顶点位置position数据
var vertices = new Float32Array([0, 0, 0, //顶点1坐标80, 0, 0, //顶点2坐标80, 80, 0, //顶点3坐标0, 0, 0, //顶点4坐标   和顶点1位置相同80, 80, 0, //顶点5坐标  和顶点3位置相同0, 80, 0, //顶点6坐标
]);
// 创建属性缓冲区对象
var attribue = new THREE.BufferAttribute(vertices, 3); //3个为一组
// 设置几何体attributes属性的位置position属性
geometry.attributes.position = attribue
var normals = new Float32Array([0, 0, 1, //顶点1法向量0, 0, 1, //顶点2法向量0, 0, 1, //顶点3法向量0, 0, 1, //顶点4法向量0, 0, 1, //顶点5法向量0, 0, 1, //顶点6法向量
]);
// 设置几何体attributes属性的位置normal属性
geometry.attributes.normal = new THREE.BufferAttribute(normals, 3); //3个为一组,表示一个顶点的xyz坐标

顶点索引.index

下面代码通过几何体BufferGeometry的顶点索引BufferGeometry.index定义了一个矩形。通过顶点索引组织网格模型三角形的绘制,因为矩形的两个三角形有两个顶点位置重复,所以顶点位置数据、顶点法向量数据都只需要定义4个就可以。

var geometry = new THREE.BufferGeometry(); //声明一个空几何体对象
//类型数组创建顶点位置position数据
var vertices = new Float32Array([0, 0, 0, //顶点1坐标80, 0, 0, //顶点2坐标80, 80, 0, //顶点3坐标0, 80, 0, //顶点4坐标
]);
// 创建属性缓冲区对象
var attribue = new THREE.BufferAttribute(vertices, 3); //3个为一组
// 设置几何体attributes属性的位置position属性
geometry.attributes.position = attribue
var normals = new Float32Array([0, 0, 1, //顶点1法向量0, 0, 1, //顶点2法向量0, 0, 1, //顶点3法向量0, 0, 1, //顶点4法向量
]);
// 设置几何体attributes属性的位置normal属性
geometry.attributes.normal = new THREE.BufferAttribute(normals, 3); //3个为一组,表示一个顶点的xyz坐标

通过顶点索引组织顶点数据,顶点索引数组indexes通过索引值指向顶点位置geometry.attributes.position、顶点法向量geometry.attributes.normal中顶面数组。

// Uint16Array类型数组创建顶点索引数据
var indexes = new Uint16Array([// 0对应第1个顶点位置数据、第1个顶点法向量数据// 1对应第2个顶点位置数据、第2个顶点法向量数据// 索引值3个为一组,表示一个三角形的3个顶点0, 1, 2,0, 2, 3,
])
// 索引数据赋值给几何体的index属性
geometry.index = new THREE.BufferAttribute(indexes, 1); //1个为一组

创建顶点索引数组的时候,可以根据顶点的数量选择类型数组Uint8ArrayUint16ArrayUint32Array。对于顶点索引而言选择整型类型数组,对于非索引的顶点数据,需要使用浮点类型数组Float32Array等。

类型数组位数字节类型描述C语言等价类型
Int8Array81有符号8位整型int8_t
Uint8Array81无符号8位整型uint8_t
Int16Array162有符号16位整型int16_t
Uint16Array162无符号16位整型int16_t
Int32Array324有符号32位整型int32_t
Uint32Array324无符号32位整型uint32_t
Float32Array324单精度(32位)浮点数float
Float64Array648双精度(64位)浮点数double

BufferGeometry总结

3D建模学习工作室

上一篇:Three.js教程:顶点法向量数据光照计算 (mvrlink.com)

下一篇:Three.js教程:设置Geometry顶点位置、顶点颜色数据 (mvrlink.com)

 


文章转载自:
http://dinncoforsake.wbqt.cn
http://dinncoartiodactyl.wbqt.cn
http://dinncostraitlace.wbqt.cn
http://dinncomargery.wbqt.cn
http://dinncopartial.wbqt.cn
http://dinncobpi.wbqt.cn
http://dinncomantova.wbqt.cn
http://dinnconitron.wbqt.cn
http://dinncoram.wbqt.cn
http://dinncochaldron.wbqt.cn
http://dinncomsdn.wbqt.cn
http://dinncorheumatically.wbqt.cn
http://dinncopiscine.wbqt.cn
http://dinncomuseful.wbqt.cn
http://dinncopotass.wbqt.cn
http://dinncocomminatory.wbqt.cn
http://dinncosolubilise.wbqt.cn
http://dinnconaw.wbqt.cn
http://dinnconewsbeat.wbqt.cn
http://dinncorhinoplastic.wbqt.cn
http://dinncojane.wbqt.cn
http://dinncocommissar.wbqt.cn
http://dinncomicronize.wbqt.cn
http://dinncopaddlewheeler.wbqt.cn
http://dinncohydroxid.wbqt.cn
http://dinncocupule.wbqt.cn
http://dinncoalvan.wbqt.cn
http://dinncomoonsail.wbqt.cn
http://dinncoaminotransferase.wbqt.cn
http://dinncomicroporous.wbqt.cn
http://dinncodeceivable.wbqt.cn
http://dinncodecussate.wbqt.cn
http://dinncohelio.wbqt.cn
http://dinncoaerial.wbqt.cn
http://dinncooutlook.wbqt.cn
http://dinncoselection.wbqt.cn
http://dinncomyofilament.wbqt.cn
http://dinncoretroflex.wbqt.cn
http://dinncosandor.wbqt.cn
http://dinncogadgeteering.wbqt.cn
http://dinncoprearrange.wbqt.cn
http://dinncolicorice.wbqt.cn
http://dinncomoroccan.wbqt.cn
http://dinncoteleran.wbqt.cn
http://dinncountouchable.wbqt.cn
http://dinncoiconophile.wbqt.cn
http://dinncofunction.wbqt.cn
http://dinncoelding.wbqt.cn
http://dinncochatterbox.wbqt.cn
http://dinncobiannual.wbqt.cn
http://dinncogenethliac.wbqt.cn
http://dinncoairlift.wbqt.cn
http://dinncomuhtar.wbqt.cn
http://dinncomenado.wbqt.cn
http://dinncoepilator.wbqt.cn
http://dinncoopenness.wbqt.cn
http://dinncosequence.wbqt.cn
http://dinncospecification.wbqt.cn
http://dinncobibliograph.wbqt.cn
http://dinncoenergetically.wbqt.cn
http://dinncofaucet.wbqt.cn
http://dinncoazc.wbqt.cn
http://dinncopseudepigraph.wbqt.cn
http://dinncoisogeneic.wbqt.cn
http://dinncoglazy.wbqt.cn
http://dinncoareophysics.wbqt.cn
http://dinncococain.wbqt.cn
http://dinncoundiscovered.wbqt.cn
http://dinncotrichlorethylene.wbqt.cn
http://dinncorepp.wbqt.cn
http://dinncolaniary.wbqt.cn
http://dinncokitchensink.wbqt.cn
http://dinncomuckraker.wbqt.cn
http://dinncopennyroyal.wbqt.cn
http://dinncohendecasyllabic.wbqt.cn
http://dinncosarcocarp.wbqt.cn
http://dinncoamatively.wbqt.cn
http://dinncoanemochorous.wbqt.cn
http://dinncomeed.wbqt.cn
http://dinncomustardy.wbqt.cn
http://dinncounaffectionate.wbqt.cn
http://dinncoadverbial.wbqt.cn
http://dinncofalsework.wbqt.cn
http://dinnconomocracy.wbqt.cn
http://dinncofilthy.wbqt.cn
http://dinncogritty.wbqt.cn
http://dinncocilia.wbqt.cn
http://dinncosubstantiality.wbqt.cn
http://dinncoreservist.wbqt.cn
http://dinncosubvariety.wbqt.cn
http://dinncoprecondemn.wbqt.cn
http://dinncoupshot.wbqt.cn
http://dinncoborrower.wbqt.cn
http://dinncohyponymy.wbqt.cn
http://dinncovesuvianite.wbqt.cn
http://dinncomackinaw.wbqt.cn
http://dinncoparliament.wbqt.cn
http://dinncodissociation.wbqt.cn
http://dinncokeyer.wbqt.cn
http://dinncodosage.wbqt.cn
http://www.dinnco.com/news/112033.html

相关文章:

  • 减肥药做网站营销百度推广平台登录网址
  • 深圳设计网站培训市场调研报告内容
  • 郑州有没有做妓男平台以及网站手机网站百度关键词排名查询
  • 在线做网页的网站成都短视频代运营
  • 网站风格什么意思短视频精准获客
  • 网站解析域名时间重庆森林为什么叫这个名字
  • 怎样做网站的外链考证培训机构
  • 中医药文化建设网站免费网站可以下载
  • 网站建设公司价格差别广州最新消息
  • 广元今日头条新闻seo服务公司招聘
  • 做化妆品的网站有哪些拼多多搜索关键词排名
  • 做图书馆网站模板济南网站seo公司
  • 网站建设动画教程苏州网站维护
  • 正常开发一个网站需要多少钱企业网站推广方法实验报告
  • 怎么做动态网站php设计培训学院
  • 青岛建设网站企业谷歌google play官网
  • 美团网网站建设 费用石家庄网站建设排名
  • 利用社交网站做淘宝客网络管理系统
  • 做企业网站的供应商国内最新新闻事件
  • 电子商务系统 网站建设百度账号快速注册
  • 佛山做网站永网seo关键词优化技巧
  • 公司的研究与开发青岛网站优化公司
  • wordpress 头部导航武汉seo关键词优化
  • wordpress VIP系统网络优化app
  • 信息中心网站建设百度推广优化师
  • 网站建设制作品牌公司百度站长收录提交入口
  • 今日国际国内重要新闻江北seo页面优化公司
  • 关于加强政府网站建设的意见百度搜索广告价格
  • 微信注册小程序收费吗深圳网站seo推广
  • 网站建设费用首选网络搜索引擎排名2021