| Joerg Scheurich aka MUFTI 2004-08-03, 7:17 pm |
| > I'm trying to build a model using coordinates stored in a text file and
> I've used PERL to extract the coordinates and and want to add a VRML
> call to this file to create a world with a 3-D model.
A VRML97 file is simply a ASCII file, you can write with PERL and
then call a VRML97 browser or browser module.
For example, a VRML file may look like the following, the "point" values
are the coordinates of the vertexes, while the coordIndex values show,
which numbers of vertexes form together a polygon.
VRML V2.0 utf8
Transform
{
children
[
Shape
{
appearance Appearance
{
material Material
{
}
}
geometry IndexedFaceSet
{
coord Coordinate
{
point
[
-3.821370e-15 -1 4.371138e-8
3.785516e-8 -1 -2.185569e-8
-3.785516e-8 -1 -2.185567e-8
3.821370e-15 -1 4.371138e-8
8.742276e-8 0 -1
-0.866024 0 0.500000
0.866024 0 0.499998
-8.742276e-8 0 -1
-3.821370e-15 1 4.371138e-8
3.785516e-8 1 -2.185569e-8
-3.785516e-8 1 -2.185567e-8
3.821370e-15 1 4.371138e-8
]
}
coordIndex
[
0 5 4 -1
1 6 5 -1
2 7 6 -1
4 5 9 -1
5 6 10 -1
6 7 11 -1
]
creaseAngle 7.999999e-2
solid FALSE
}
}
]
rotation 0.160189 0.972267 0.170395 3.291328
}
|