[vtkusers] doubts about vtkVRMLImporter

Fabiano Stange fpaulico1 at gmail.com
Thu Dec 20 14:28:49 EST 2012


Hi!
I have some doubts about vtkVRMLImporter.
I am using VTK version 5.4 and Visual Studio C++ 2008 to import a wrl file.
But it is not working very well.
If the wrl file has more then one DEF node, vtk only visualizes the first
DEF node.

For example, a solid model like a building can be writing in wrl format
using a DEF node for which object (foundations, columns, beams, slabs,
walls and roofs).
Here is a part of the wrl file i like to visualize in vtk:

#VRML V2.0 utf8

DEF Structural_Columns_<M_Concrete_Square_Column_:_500_x_500mm> Transform {
translation -10700 4650 -17490
children DEF Structural_Columns_<M_Concrete_Square_Column_:_500_x_500mm>_0
Transform {
translation 0 0 0
children Shape {
appearance Appearance {
material Material {diffuseColor 1 0 1}
texture ImageTexture {
url "
http://t3.gstatic.com/images?q=tbn:ANd9GcSNUBcHJyaWrODD9_EyOSBRAvBB_3dRhTlocB1S6qEk5Mz3XW9x2w
"
repeatS TRUE
repeatT TRUE
}
}
geometry DEF
Structural_Columns_<M_Concrete_Square_Column_:_500_x_500mm>_0-FACES
IndexedFaceSet {
ccw TRUE
solid TRUE
coord DEF
Structural_Columns_<M_Concrete_Square_Column_:_500_x_500mm>_0-COORD
Coordinate {point [...]}
coordIndex [ ... ]
}
}
}
}

DEF Structural_Columns_<M_Concrete_Square_Column_:_500_x_500mm>_01
Transform {
translation -5204 7750 -17490
children DEF Structural_Columns_<M_Concrete_Square_Column_:_500_x_500mm>_02
Transform {
translation 0 0 0
children Shape {
appearance Appearance {material Material {diffuseColor 1 0 1}}
geometry DEF
Structural_Columns_<M_Concrete_Square_Column_:_500_x_500mm>_02-FACES
IndexedFaceSet {
ccw TRUE
solid TRUE
coord DEF
Structural_Columns_<M_Concrete_Square_Column_:_500_x_500mm>_02-COORD
Coordinate {point [...}
coordIndex [...]
}
}
}
}
...

Even if i use the group node vtk still visualizes the first DEF node.
And there is more problems.
The first DEF node that vtk visualizes does not read the Appearance node,
the Material node and the Color node.

I am using the example in http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/VRML.
Is something wrong or the vtkVRMLImporter works like that?

Thanks,
Fabiano Stange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20121220/024f1a3f/attachment.htm>


More information about the vtkusers mailing list