首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在Meshlab上导入VRML2.0

如何在Meshlab上导入VRML2.0
EN

Stack Overflow用户
提问于 2017-09-15 14:35:12
回答 1查看 1.5K关注 0票数 0

我试图在Meshlab上导入这个VRML文件的文件:

代码语言:javascript
复制
#VRML 2.0 utf-8
PROTO my_sphere [ exposedField SFFVec3f xyz 0 0 0 ] {
    Transform {
        translation IS xyz
        children [
            Shape {
                appearance Appearance { material Material { 
diffuseColor 1.0 0.05 0.05 } }
                geometry Sphere { radius 0.66 }
            }
        ]
    }
}
my_sphere { xyz 0.0 0.0 0.119 } # 0
my_sphere { xyz 0.0 0.0 0.119 } # 1

我得到了错误:

代码语言:javascript
复制
Error encountered while loading file:
"/my_path/test.wrl"

File: /my_path/test.wrl
Error details: -- line 2 col 32: invalid FieldType
-- line 4 col 42: "{" expected

如何导入这种类型的文件?在搅拌机上我很容易就能做到。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-09-21 16:45:22

除了原始示例中的拼写错误(应该是SFVec3f,而不是SFFVec3f)之外,2016.12版的Meshlab不支持原始球几何。Meshlab确实支持使用PROTO语句,该语句使用IndexedFaceSet几何学‘返回’形状。下面是一个示例VRML97场景,生成两个四面体实例作为网格定义的形状:

代码语言:javascript
复制
#VRML 2.0 utf-8
 PROTO my_tetrahedron [ exposedField SFVec3f xyz 0 0 0 ] {
     Transform {
         translation IS xyz
         children [
      Shape {
        appearance Appearance {
          material Material {
            diffuseColor 0.0 1.0 0.0
          }
        }
        geometry IndexedFaceSet {
          coordIndex [ 3 1 0 -1  3 2 1 -1  3 0 2 -1  0 1 2 -1]
          coord Coordinate {
            point [0.29 0.50 -0.20 0.29 -0.50 -0.20 -0.58 0.00 -0.20 0.00 0.00 0.61]
          }
        }
      }
         ]
     }
 }


# [Scene] ========== ========== ==========


my_tetrahedron { xyz 0.0 0.0 0.0 } 
my_tetrahedron { xyz -1.0 -1.0 -1.0 }

Meshlab 2016确实将此作为两个网格来导入。

提出原始问题的解决方案:用IndexedFaceSet定义的几何替换VMRL场景中的球面几何

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46242089

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档