|
From: Alan L. <li...@ix...> - 2001-04-05 20:12:43
|
Folks,
I'm new to OpenVRML and I need a little assistance to get headed in the
right direction. I have a surface model of the abdomen in VRML. There are
(approx) 20,000 texture-mapped polygons. Here's the (abbreviated) VRML file.
#VRML V2.0 utf8
Shape{
appearance Appearance{
texture ImageTexture{
url "abdomen.jpg"
repeatS FALSE
repeatT FALSE
}
}
geometry IndexedFaceSet {
coord Coordinate{
point[
-95.375192 39.910000 284.234892,
"
"
"
22.465226 90.419998 -30.414945
]
}
normal Normal{
vector[
-0.691915 0.222542 -0.686825,
"
"
0.805935 -0.569265 0.162499
]
}
coordIndex[
0 1 2 -1
"
"
33771 33772 33773
]
solid FALSE
normalPerVertex TRUE
texCoord TextureCoordinate{
point[
0.333287 0.919887,
"
"
0.782706 0.692425
]
}
texCoordIndex[
0 1 2 -1
"
"
33771 33772 33773
]
}
}
I'd like to use this model with a separate collision detection and
deformation library written in C++. To do this, I need to be able to
extract the vertices and the associated polygonal indices. I'm having some
trouble doing this.
Here's my code fragment:
VrmlScene scene;
VrmlNodeType *node_type;
VrmlMFNode *nodes;
VrmlNode *node;
char junk;
scene.load(argv[1]);
// try to find the coordinate node type
node_type = (VrmlNodeType*) scene.scope()
->findType("Coordinate");// works
node = node_type->firstNode(); // returns null
// try to find the IndexedFaceSet node type
node_type = (VrmlNodeType*) scene.scope()
->findType("IndexedFaceSet"); // works
node = node_type->firstNode(); // returns null
In short, I can't seem to find the correct function calls to access the
data. Can somebody tell me what I'm doing wrong?
Thanks much!
Al
|