Closed ghost closed 5 years ago
I'll have a look.
BTW: Can you also share one of the WRL files that don't work in other browser?
Here's a gist with the .wrl file contents.
It seems all other .wrl files exported from this application (Helitronic Tool Studio) also fail in the same way.
The PR closed the issue but I still looking for your WRL file 👍
The general Safari issue is fixed in dev
:
https://raw.githack.com/mrdoob/three.js/dev/examples/webgl_loader_vrml.html
It was necessary to change one of the regular expression since it was not evaluated correctly in Safari! Crazy stuff...
Awesome, thank you! 🙏
I've investigated the other VRML file and found a strange issue. Some shape definitions contain no definition of coord
and coordIndex
:
Shape {
appearance Appearance {
material Material {
diffuseColor 0.700 0.700 0.700
ambientIntensity 0.500
specularColor 0.500 0.500 0.500
shininess 0.500
transparency 0.000
}
}
geometry IndexedFaceSet {
color Color {
color [
0.435 0.000 1.000
]
}
}
}
Geometries like this are not valid since the actual vertex data are missing. In other words, you can't render a geometry with just its color data. So this looks like a bug in the exporter of your content creation tool.
May I ask, how should the model ex-2.wrl
look like? Can you share a screenshot of the intended result?
This is what it looks like loaded in r105. Also works by dragging the file (or any file exported by the program) into the r105 editor.
And just to verify it works, I copied the gist I posted earlier into a new file and loaded it to make sure the contents are the same.
I'll update gh-pages
.
Done!
Still getting this error with ex-2.wrl
in https://threejs.org/editor/ though...
I was able to load ex-2.wrl
with the last PR. The loader is now a bit more fault-tolerant. However, it logs a warning to notify about the missing geometry data.
Awesome, it works now. Just one minor problem, is that the material reproduction might be off. It's an easy fix though, I just need to change each material's shininess
, specular
, and emissive
props to match the original. This is probably a result of the new loader more closely adhering to the VRML spec, right?
r105
on the left, dev
/r106.x
on the right
This is probably a result of the new loader more closely adhering to the VRML spec, right?
Yes, the loader implements the VRML spec more strictly than before. That was also the reason why your geometries could not processed in the first place.
Description of the problem
Example just results in a black screen with the following error:
Also, the VRML files I've been working with stopped parsing correctly on all browsers with the new dependency added, but that's probably for a separate issue.
Three.js version
Browser
OS