Three.js: VRML Example Doesn't Work on Safari after r106

Created on 26 Jun 2019  路  13Comments  路  Source: mrdoob/three.js

Description of the problem

Example just results in a black screen with the following error:

image

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
  • [x] r106
Browser
  • [x] Safari
OS
  • [x] macOS
Bug

Most helpful comment

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.

All 13 comments

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.

image

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...

Screen Shot 2019-06-27 at 4 21 52 PM

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?

Screen Shot 2019-06-28 at 10 28 48 AM

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

donmccurdy picture donmccurdy  路  3Comments

danieljack picture danieljack  路  3Comments

makc picture makc  路  3Comments

yqrashawn picture yqrashawn  路  3Comments