[X3D-Public] VRML to X3D converter

Michalis Kamburelis michalis.kambi at gmail.com
Wed Jul 27 11:11:13 PDT 2011


2011/7/1 Campbell Barton wrote:
> I would like a simple command line application or library (preferably
> C/C++) to convert VRML to X3D, so we can drop VRML support in
> Blender3D and have the importer call the converter when its needed.
> This way I can just make use of an XML library and not have a VRML
> parser which is not that good anyway.
>
> Anyone know of a good converter?
>

Hi,

The latest release of view3dscene 3.10.1 was shamelessly done so I can
answer: yes, you can use view3dscene to convert VRML2->X3D :) It
includes a stable (preserves VRML/X3D nodes graph fully), GPLed
converter from VRML 2 to X3D. Can be used interactively ("File -> Save
As.." menu options), or from command-line ("view3dscene --write
--write=encoding=xml input.wrl > output.x3d"). You can also use
tovrmlx3d, to have a small binary that doesn't need GUI libs installed
("tovrmlx3d --encoding=xml input.wrl > output.x3d").

You can also use it to convert X3D classic encoding into X3D XML
encoding. I guess you will find this useful, if the idea is to get rid
of parsing classic VRML/X3D content in Blender and only deal with XML
flavor.

Get view3dscene from http://vrmlengine.sourceforge.net/view3dscene.php
. Converter notes are on the same page,
http://vrmlengine.sourceforge.net/view3dscene.php#section_converting .

My engine is LGPL (>= 2). view3dscene and tovrmlx3d are strict GPL (>=
2). (although LGPL can be negotiated for tovrmlx3d if needed, as it's
such trivial program :)

This is "normal" native code, so it can be compiled into an .so / .dll
if you prefer to have a library instead of a callable program. This is
not C/C++ (this is ObjectPascal, compiled by open-source
cross-platform http://www.freepascal.org/), but it's still normal
native code, so integration with C is trivial.

This can be used for more than just VRML 2 / X3D -> X3D. You can even
use this to import other formats (like 3DS or MD3) into Blender
through X3D XML. If needed, I could also add some special conversion
modes that "expand" some stuff, for example converting difficult X3D
shapes (like NURBS or Extrusion) into simpler (like IndexedFaceSet);
such conversions are done "under the hood" anyway in my engine, so
making them available for output should not be difficult, if they
would be useful.

Michalis



More information about the X3D-Public mailing list