-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
explain the custom layer threejs examples scale factor #8508
Comments
@ryanbaumann do you remember how you arrived at that number? |
The scale came from @andrewharvey’s original gist: https://gist.github.com/andrewharvey/7b61e9bdb4165e8832b7495c2a4f17f7#file-index-html |
The scale from the example, was found by hand (I had a slider and manually found the right value so that the model lined up with the map). I'm working on a PR to improve the example to remove this magic number, but essentially if your model is in meters, then:
Of course if you're just loading a building this is fine, if your model is a whole country, then you'll still have errors since you're not projecting the model, but that's a whole different matter. |
closing, barring further actions |
I agree, the explanation here should suffice. We'll have #8524 in the next release which together with https://github.com/mapbox/mapbox-gl-js-docs/pull/23 does away with the magic number for the scale factor. |
mapbox-gl-js version: N/A
Question
Thanks for the great example of loading a GLTF 3D model with 3JS here. Can anyone explain how the scale factor that was used, was chosen? I cannot find any information on where
5.41843220338983e-8
comes from. Thanks!Links to related documentation
Live demo of the the same example
The text was updated successfully, but these errors were encountered: