mrdoob / three.js

JavaScript 3D Library.
https://threejs.org/
MIT License
101.71k stars 35.3k forks source link

VRMLLoader parse error #19415

Closed d-packs closed 4 years ago

d-packs commented 4 years ago

I have two sample wrl files, both do not load correctly (tested in Firefox and Chromium). Error is Uncaught Error: THREE.VRMLLoader: Parsing errors detected.

capture-200521-203144 To test I have replaced the model in examples/webgl_loader_vrml.html with my models.

Test files:

File 1 wrl.zip File 2 .wrl.zip

Three.js version

0.115.0

Browser
OS
Mugen87 commented 4 years ago

Your files are VRML 1.0 files which are not supported by the loader. You have to use VRML 2.0.

Unfortunately, I can't even import the files into Blender or Meshlab since I wanted to test a conversion to 2.0.

d-packs commented 4 years ago

thank you for the clarification.

Mugen87 commented 4 years ago

Please let me know if you find a way to convert them from 1.0 to 2.0. Such a tool could be useful in future support cases.

WestLangley commented 4 years ago

@Mugen87 It seems the version check needs to occur earlier.

cecilemuller commented 4 years ago

@Mugen87 For converting VRML1 to VRML2:

Mugen87 commented 4 years ago

@cecilemuller Thank you!

d-packs commented 4 years ago

I've used the converter at (http://www.interocitors.com/polyhedra/vr1tovr2/) to generate v2 files. But the file won't display at all. No parsing error this time. The file is being retrieved by the script., no CORS error or anything. capture-200522-115248

Here are the converted files test-modelsvrml-v2.zip

cecilemuller commented 4 years ago

I looked at the converted files in Vrmlpad (to check for code errors) and BS Contact (to check for visual errors), but they look valid, the conversion worked.

Perhaps it's just a Viewpoint position issue (given Contact zooms out to fit the bounding box of the geometry when there is no Viewpoint in the scene).

Mugen87 commented 4 years ago

Ah, the problem is that VRMLLoader does not process the Collision node yet. I think we can easily fix this by treating such nodes like other grouping nodes.