VRML to X3D Conversion

折月煮酒 提交于 2019-12-03 03:43:00
zmbq

MeshLab! There's an opensource project called MeshLab that does all sorts of processing on 3D meshes. It also has a command-line tool called MeshlabServer.

Running meshlabserver.exe -i <wrl file> -o <x3d file> performs the conversion (very quickly). Since it's open-source, I don't have any licensing issues.

are you talking about this online converter? http://doc.instantreality.org/tools/x3d_encoding_converter/ you could probably build some scripting to convert the vrml to x3d/x3dom and then store and or display

as well blender aopt and others should be able to convert vrml to x3d on the command line. depending on your servers os this could be batched/scripted as well

im in a rush to get some other work done but hope this helps.

let me know if you need more info or examples and ill see what i can do

ok so i think this is the full solution for you

1) user uploads a vrml file

2) that file gets saved to (file or db)

3) upon confirmation that the vrml file has been saved (and possibly validated as correct vrml syntax) it gets converted and saved to x3d (again as file or db) , with aopt this would be accomplished by aopt -i input.wrl -o output.x3d

FYI: aopt is avail for linux windows and mac

since you use python this maybe a way you could do it as well with blender although there are no full example of vrml to x3d this link should get you started http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Import-Export/Wavefront_OBJ#Command_Line_Converting

4) display the x3d via x3dom

I also needed to convert VRML .wrl to .x3d; I tried meshlab (meshlabserver), but unfortunately, the version I have (.deb 2016.12~trusty2 on Ubuntu 14.04) compacts everything to a single mesh, and looses color in the process.

I found that view3dscene can do conversion from the command line, where the materials/colors are preserved in .x3d, as they were in .wrl:

view3dscene mymodel.wrl --write --write-encoding xml > mymodel.x3d

Since view3dscene functions as a viewer for both .wrl and .x3d files, it can also be used immediately, to check if the converted (or the original) file has colors or not.

If you simply want to convert X3D XML encoded files to VRML Classic encoded files you can use Titania, http://titania.create3000.de/. Open your .x3d file and save it as .x3dv or .wrl.

Titania also comes with a command line utitity »x3dtidy« that can do the conversion too.

You can use this tool (a java jar that can be run from the command line) to convert VRML to X3D:

http://www.deem7.com/vrmlmerge/howto.php

java -jar VrmlMerge-[version].jar -convert inputfile.wrl [outputfile.x3d] 

The license:

VrmlMerge is free for non-commercial use. If you somehow make money out of VrmlMerge then I'd like you to contact me to agree on some terms of use. VrmlMerge is provided "as is" and I don't take any responsibility for any damage it can make to you, your computer, files, data, wife, brain etc..

Since the ClassicVRML X3D Encoding is a direct successor of the VRML97 standard, in most cases you can copy the file, rename the .wrl file extension to a .x3dv file extension, and change the scene header from

#VRML V2.0 utf8

to

#VRML V3.3 utf8
PROFILE Immersive

Many converters exist, both commercial and open source. A full list is maintained at

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!