peterqliu / threebox

A three.js plugin for Mapbox GL JS, with support for basic animation and advanced 3D rendering.
MIT License
528 stars 320 forks source link

Upgraded threebox -> busted coordinates #61

Open bennlich opened 5 years ago

bennlich commented 5 years ago

Heyo! I tried upgrading my version of threebox to check out the tube example mentioned in https://github.com/peterqliu/threebox/issues/56. It seems like something changed with the units that threebox expects from my geometry coordinates.

In the version of threebox I was previously using (not sure what version), my map looked like this:

Screenshot from 2019-05-09 21-44-19

In the new version (0.3.0), my map looks like this:

Screenshot from 2019-05-09 21-46-22

I.e. everything is bigger, and the tube positions are incorrect.

Did something change with the way threebox interprets mesh coordinates?

peterqliu commented 5 years ago

@bennlich a test case would help here. how did you construct your tube in the previous version, without the new method introduced in 0.3.0?

bennlich commented 5 years ago

@peterqliu K. I'll cook up a small example.

I constructed a TubeBufferGeometry with coordinates in meters relative to a (lat, lng) origin. Then added to scene with threebox.addAtCoordinate(mesh, origin).

bennlich commented 5 years ago

Here's a gist. Try rendering this with 0.3.0 and with an earlier version, and you should see the tube dramatically change size. Let me know if you need me to send you the earlier version of threebox I am using.

https://gist.github.com/bennlich/ac7962b8fda70ae65f8a4d031384eaa1

bennlich commented 5 years ago

You can see the same change in size with the basic threebox cube example too. Let me know if you are able to repro. I hope I'm not accidentally using some doctored version of threebox.