Martin Gorner
Martin Gorner

Reputation: 13

Collada model transparency not loading in three.js

I have a similar issue as in this post, using the same model, also loaded with the Collada loader.

The windows of the car are not displayed as transparent in three.js. You cannot see through them.

After digging through the three.js object data structures, it looks like the material for the window has opacity = 1 and transparent = false set on it.

I tried both with the release and with the dev version of three.js, as advised in the above referenced post but without any luck.

I also tried setting the opacity to 0.3 and transparent to true by hand in the material object (in debugger) and the transparency appears ! (although with some flickering).

Any idea what is wrong ? Is it a Collada loader problem ?

UPDATE: same problem on a much simpler model:

screenshot of the problem

link to the SketchUp model

Thank you

Martin

Upvotes: 1

Views: 1649

Answers (2)

Martin Gorner
Martin Gorner

Reputation: 13

I still do not know if this is a ColladaLoader bug, a SketchUp issue or a bizarre feature of the Collada spec but I found an easy enough workaround:

Edit the Collada file by hand, find the tag and set its value by hand to 0.3 or anything you want instead of 1.

Not perfect but workable.

Upvotes: 0

jterrace
jterrace

Reputation: 67073

I just tried this and it's working for me. I took the model from open3dhub and imported it into ThreeFab and then exported it to a jsfiddle(source). I still see the flickering (that's a separate problem). This is on three.js from master.

enter image description here

Upvotes: 2

Related Questions