2017-09-15 69 views
0

我试图导入上Meshlab这个VRML文件的文件:如何导入VRML 2.0 Meshlab

#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 

我怎么能导入此文件类型?我可以很容易地在Blender上做到这一点。

+0

类型某某领域是在列表中拼错定义的,它应该是SFVec3f。但是,即使有这种变化,Meshlab 2016也不会导入。 Meshlab X3D/VRML导入可能不支持PROTO语句。 –

+0

在http://www.web3d.org/x3d/content/examples/Basic/X3dSpecifications/RedSphereBlueBoxIndex.html处的X3D示例的进一步实验 - 以VRML97的形式下载 - 显示Meshlab不支持Sphere的原始形状和框。看来只有像IndexedTriangleSet这样的网格节点才被支持 –

+0

@VincentMarchetti哦,那么,如果它拼错了,为什么它在Blender上工作?它被解释为别的吗? – izxle

回答

1

除了原始示例中的拼写错误(它应该是SFVec3f,而不是SFFVec3f)之外,Meshlab在2016.12版中不支持原始Sphere几何。 Meshlab支持使用使用IndexedFaceSet几何体返回Shape的PROTO语句。下面是一个例子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并导入此为两个网格。

建议解决原来的问题:更换球体形状的VMRL场景的几何形状通过在IndexedFaceSet