栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

如何将三角形的绕组校正为3D Mesh模型的逆时针方向?

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

如何将三角形的绕组校正为3D Mesh模型的逆时针方向?

要获取相邻信息,请假设我们有一种方法可以
在给定的边上返回三角形的邻居neighbor_on_egde( next_tria, edge )。

该方法可以使用在每个
三角形中使用每个顶点的信息来实现。那是将顶点索引映射到
三角形索引列表的字典结构。通过遍历
三角形列表并为右
字典元素中的三角形的每个三角形顶点索引设置,可以轻松地创建它。

通过存储要检查方向的
三角形以及已检查哪些三角形来完成遍历。当有三角形要检查时,对其进行
检查,并添加要检查的邻居(如果未选中)。
伪代码如下所示:

to_process = set of pairs triangle and orientation edge  initial state is one good oriented triangle with any edge on itprocessed = set of processed triangles; initial emptywhile to_process is not empty:    next_tria, orientation_edge = to_process.pop()    add next_tria in processed    if next_tria is not opposite oriented than orientation_edge:        change next_tria (ABC) orientation  (B<->C)  for each edge (AB) in next_tria:      neighbor_tria = neighbor_on_egde( next_tria, edge )      if neighbor_tria exists and neighbor_tria not in processed:          to_process add (neighbor_tria, edge opposite oriented (BA))


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/446547.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号