×
热门分类
微信扫码登陆

QQ登录

只需一步,快速开始

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?立即加入SketchUp吧! 微信扫码登陆

x
  请教一个关于SKP SDK mesh_helper SUMeshHelperGetVertexIndices返回个数的问题  。我通过model 获取到entities(所有的),然后通过entities获取到face,通过face 获取到mesh_helper,但是通过mesh_helper 里面的方法SUMeshHelperGetVertexIndices获取到的count 182。我现在需要用到其返回值indices[].文档中的原文解释是:Retrieves the array of indices of thevertices of a triangle mesh object. The each element indexes into the arraysretrieved with SUMeshHelperGetVertices, SUMeshHelperGetFrontSTQCoords, SUMeshHelperGetBackSTQCoords and SUMeshHelperGetNormals. The elements are sorted so that every three elements (i.e.,stride of three) compose the indices to the three vertices of a triangle.
我理解的就是会返回一个triangle的数组,然后每3个步长为一个数据单位,其中含有的为vertice/frontUV or back UV /normals   这样的组成,其中frontUV or back UV 只会取其中某一个的值。
假如是一个正方形,并连接某一条斜边,能够组成0,1,2,3   这样的值。能够组成{0,1,2} , {0,2,3}2组三角形,triangle 的值就有6个。Triangle[0] = 0, triangle[1]=1, triangle[2]=2, triangle[3]=0, triangle[4]=2, triangle[3] = 3; 其中triangle[0 -2] 中,triangle [0]对应vertice indices, triangle[1] 对应UV  indices triangle[2]对应 normals   indices
现在我从某个mesh_helper 获取到的个数为182个,不能被3整除,是我的理解有问题,还是怎么的?求告知。
现主要做组装unity Mesh 对象,想通过此API 获取对应值填充到mesh. triangles,如果有做过类似的,麻烦请告知,我这样填充是否正确。

精彩评论

文明上网理性发言、请文明用语

1

主题

3

帖子

0

红宝石

SU入学(等级1)

Rank: 1

红宝石
0
feng271374203 2019-11-19 11:00:21
来个人指点下啊

1

主题

3

帖子

0

红宝石

SU入学(等级1)

Rank: 1

红宝石
0
feng271374203 2019-11-20 18:31:25
已解决,理解有误,len为SUMeshHelperGetNumTriangles 的返回值 乘以3 ,然后再获取。并且需要处理单个的mesh不能将所有的vertice ,UV,normals    进行累加后组装。
高级模式
您需要登录后才可以回帖 登录 | 立即加入SketchUp吧! 微信扫码登陆

本版积分规则

feng271374203

SU入学(等级1)

  • 主题

  • 吧币

  • 红宝石

关闭

站长推荐上一条 /2 下一条

积分兑换活动
发布主题 快速回复 返回列表 客服中心 搜索 官方QQ群
关于我们/小黑屋/手机app/国土人/SketchUp吧 /京ICP备16008035号/