Skip to content
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

add 3D model with three.js example #7977

Merged
merged 4 commits into from
Mar 5, 2019

Conversation

andrewharvey
Copy link
Collaborator

Launch Checklist

  • briefly describe the changes in this PR

Adds an example for adding a 3D model to a Mapbox map using three.js. This is quite a common request and having an official example should help point people in the right direction.

Give we have https://docs.mapbox.com/mapbox-gl-js/example/custom-style-layer/ this is probably enough to close #7330

To give credit where it's due, this example started off as @ansis's debug page, which was then developed by @andrewharvey into https://bl.ocks.org/andrewharvey/7b61e9bdb4165e8832b7495c2a4f17f7, which was further developed by @ryanbaumann into https://bl.ocks.org/ryanbaumann/b9725e79b5b1742d92ada00ddbf5c3d3, and finally further developed by @andrewharvey into this.

The 3D model included as an asset is public domain https://nasa3d.arc.nasa.gov/detail/jpl-vtad-dsn70 https://github.com/nasa/NASA-3D-Resources. I'm open to using something else if anyone has anything better, like a detailed skyscaper, but I think it's more important to get an official example than be held up by what it looks like.

  • manually test the example page

@andrewharvey andrewharvey marked this pull request as ready for review March 1, 2019 11:33
Copy link
Member

@mourner mourner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! The only thing I'm a bit bummed about is that it's 3+ MB to add to the repo, and it loads for a considerable amount of time before being displayed. Perhaps there's an easy way to simplify the mesh in the GLTF data?

@andrewharvey
Copy link
Collaborator Author

This is great! The only thing I'm a bit bummed about is that it's 3+ MB to add to the repo, and it loads for a considerable amount of time before being displayed. Perhaps there's an easy way to simplify the mesh in the GLTF data?

I agree that this example should use a minimal model, I'm more concerned about the load time of the example.

I've not been able to find a good sample model yet, I think it's better to at least get this example out there, and can follow up with a change of the model down the track to use something simpler.

@mourner mourner merged commit 2ae5621 into publisher-production Mar 5, 2019
@mourner mourner deleted the custom-layer-threejs-example branch March 5, 2019 09:28
mourner added a commit that referenced this pull request Mar 21, 2019
* publisher-production: (41 commits)
  bump publisher after timeout (#8058)
  cosmetic update to draggable Marker/point examples to prevent coordinates overlapping Mapbox logo (#8057)
  update mapbox style and tileset version numbers to most recent (#8056)
  update docs page shell (#8039)
  [email protected]
  Add create-image script to generate example thumbnails (#8029)
  Add HTML clusters + aggregated properties example (#8019)
  add 3D model with three.js example (#7977)
  update mapbox-gl-geocoder to @3.1.4 in examples (#7978)
  V0.53.1 (#7961)
  rename example for accepting coordinates in the geocoder (#7859)
  [docs] use appropriate-images for examples to increase page speed (#7900)
  [docs] dr-ui 0.6.0 (#7909)
  version bump gl-geocoder to v3.1.2 (#7924)
  Fix docs for Camera methods
  Docs page shell update 02-14-19 (#7907)
  fixes regression with css on examples pages (#7891)
  updates sentry project for docs subdomain (#7890)
  v0.53.0 (#7884)
  [docs] update dr-ui 0.5.0 (#7880)
  ...
mourner added a commit that referenced this pull request Mar 21, 2019
* publisher-production: (41 commits)
  bump publisher after timeout (#8058)
  cosmetic update to draggable Marker/point examples to prevent coordinates overlapping Mapbox logo (#8057)
  update mapbox style and tileset version numbers to most recent (#8056)
  update docs page shell (#8039)
  [email protected]
  Add create-image script to generate example thumbnails (#8029)
  Add HTML clusters + aggregated properties example (#8019)
  add 3D model with three.js example (#7977)
  update mapbox-gl-geocoder to @3.1.4 in examples (#7978)
  V0.53.1 (#7961)
  rename example for accepting coordinates in the geocoder (#7859)
  [docs] use appropriate-images for examples to increase page speed (#7900)
  [docs] dr-ui 0.6.0 (#7909)
  version bump gl-geocoder to v3.1.2 (#7924)
  Fix docs for Camera methods
  Docs page shell update 02-14-19 (#7907)
  fixes regression with css on examples pages (#7891)
  updates sentry project for docs subdomain (#7890)
  v0.53.0 (#7884)
  [docs] update dr-ui 0.5.0 (#7880)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants