Limitations: Only Polygon graphic primitives are supported. However, the polygons are constructed by using a shared set of points, which makes the rendering faster and gives the VRML browser better hints how to shade the polygons.
Note: The program is free software; you can redistribute it and/or modify it. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
source: m2wrl.m
known bugs: the seams
<<m2wrl.m
ParametricPlot3D[{(2 + Sin[2 Pi u]) Cos[2 Pi t],
(2 + Sin[2 Pi u]) Sin[2 Pi t], Cos[2Pi u]},
{t, 0, 1}, {u, 0, 1}]
m2wrl[%]
OpenWrite["m2wrl-torus.wrl"]
WriteString[%, %%]
Close[%%]
Enjoy!
Keywords: m2wrl, mtowrl, Mathematica, mma, Graphics3D, Polygon, virtual reality modeling language, VRML, VRML 1.0, world/vrml, x-world/x-vrml, Mathematica converter, Mathematica document converter, Mathematica graphics converter, Mathematica 3D graphics converter, Mathematica to VRML converter, conversion, converter, convert, source code