VRML to X3D conversion

Asked by Josh on 2015-03-18

Do you know of any good converters or is this functionality in the Titania project some where?

Question information

English Edit question
Titania Edit question
No assignee Edit question
Solved by:
Holger Seelig
Last query:
Last reply:
Josh (s-josh-s) said : #1

Think I found one, just going to go get it, but don't know if its open source or not



Josh (s-josh-s) said : #2

Here is an open source solution
meshlabserver.exe -i <wrl file> -o <x3d file

from this page

Josh (s-josh-s) said : #3

Problem with the meshlabserver solution, It collapses all the inlines into the top level and makes one big x3d.

Titania "Save as" does what I want, but would need command line access to "Save as" for vrml to x3d then just run through all the source files and convert.

I looked around in the source code, but can't find any examples to script the "Save as" code.

Holger Seelig (holger-seelig) said : #4

There is a utility program »x3dtidy« that comes with Titania, that does the job. Just run
x3dtidy -h
to get some help. If the outfile has the suffix *.x3d then the file is converted to X3D XML Encoding. Input can be any *.x3d, *.x3dv or *.wrl.

Josh (s-josh-s) said : #5

I tried that, doesn't work. just saves it in #VRML V2.0 utf8 Titania V0.7.6

Best Holger Seelig (holger-seelig) said : #6

Have commited a fix.

Josh (s-josh-s) said : #7

Looks like its working.

Great job.

Thanks again.

Holger Seelig (holger-seelig) said : #8

If you have Inline nodes in the file, don't forget to do a search 'n replace on the url field to change *.wrl to *.x3d.

Josh (s-josh-s) said : #9

sed -i -e "s:\.wrl:\.x3d:g" "$inputfolder/${f%.wrl}.x3d" # Change wrl extension to x3d

Already done, thanks for the hint though.

It works great.

Josh (s-josh-s) said : #10

Thanks Holger Seelig, that solved my question.