我试图在Meshlab上导入这个VRML文件的文件:
#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我得到了错误:
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如何导入这种类型的文件?在搅拌机上我很容易就能做到。
发布于 2017-09-21 16:45:22
除了原始示例中的拼写错误(应该是SFVec3f,而不是SFFVec3f)之外,2016.12版的Meshlab不支持原始球几何。Meshlab确实支持使用PROTO语句,该语句使用IndexedFaceSet几何学‘返回’形状。下面是一个示例VRML97场景,生成两个四面体实例作为网格定义的形状:
#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场景中的球面几何
https://stackoverflow.com/questions/46242089
复制相似问题