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

First person POV map with lidar #397

Closed
isc-rsingh opened this issue Oct 31, 2017 · 9 comments
Closed

First person POV map with lidar #397

isc-rsingh opened this issue Oct 31, 2017 · 9 comments

Comments

@isc-rsingh
Copy link

Is there an example of creating a 1st-person POV map (altitude = 0)? It seems like https://github.com/uber/deck.gl/blob/master/docs/api-reference/first-person-viewport.md would be a place to start but I can't figure out how to implement it with react-map-gl.

@ibgreen
Copy link
Contributor

ibgreen commented Oct 31, 2017

@rarjsingh Nothing "official" yet.

However, there is an "unreleased" example in deck.gl master examples/wip/first-person-view. It is part of ongoing deck.gl 4.2-alpha development and uses "unstable" deck.gl APIs. It may require running npm run start-local instead of npm run start.

Note that mapbox will clamp pitch to 60 degrees so we stop showing the mapbox basemap when exceeding that pitch (which is usually the case in first person view). But all your deck.gl overlays will of course still be visible in full 3D and you can combine various views to still show the map.

Also, there are screenshots of our internal visualizations on the framework suite website (vis.gl), showing what is possible.

@isc-rsingh
Copy link
Author

Thanks @ibgreen I got that example running -- I think. Had to update the versions of deck.gl and yuma.gl in examples/trips and run yarn there too, which was a bit of a gotcha. But when I run it I see a single "viewport" I think. The code suggests I'll see 3 viewports?
first-person-map

@ibgreen
Copy link
Contributor

ibgreen commented Nov 1, 2017

You are building against local source right (npm run start-local)?

@isc-rsingh
Copy link
Author

Very cool @ibgreen! I got it to work. Webpack config still perplexes me most of the time, and yarn is new to me. So npm run start-local didn't work at first. Then I ran yarn from the root directory, which allowed npm run start-local to work from the examples/wip/first-person-view directory. The key was understanding that the --env.local flag on the webpack-dev-server command was triggering the last line of webpack.config.js to be called (which the comment in that file actually makes clear), which triggers the use of webpack.config.local in the root directory. Just being verbose here to help those who come after me.

Do you think there's a technical reason why Mapbox clamps pitch to 60 degrees, or just an aesthetic one?

@isc-rsingh
Copy link
Author

first-person-pov example

@ibgreen
Copy link
Contributor

ibgreen commented Nov 1, 2017

Do you think there's a technical reason why Mapbox clamps pitch to 60 degrees, or just an aesthetic one?

The number of tiles they'd need to load to cover the visible map becomes very large as pitch increases, so they chose to limit pitch. My thinking is that they could instead just cap the number of tiles at 60 degrees, and render a "blur" for the missing tile. Due to perspective shortening those tiles close to the horizon will just occupy a fairly thin band so they wouldn't show much detail anyway. There is a mapbox issue open on it, called configurable max pitch I believe.

@isc-rsingh
Copy link
Author

Nice I see the issue. I'll add my voice.
mapbox/mapbox-gl-js#3731

@isc-rsingh
Copy link
Author

@ibgreen I've been getting nowhere for the last 24 hours so I'm sorry to bother you again but I hope you can help. I can't get my own lidar data to work with this example. It's in long/lat coordinates and I can't get it to show up on this map. I use coordinateSystem: COORDINATE_SYSTEM.IDENTITY and no coordinateOrigin.

@ibgreen
Copy link
Contributor

ibgreen commented Nov 2, 2017

coordinateSystem: COORDINATE_SYSTEM.IDENTITY is for non-geospatial data.

If your points are lng/lat/z (z in meters) you want the default LNGLAT coordinate system. You may need to flip on fp64 if you are zoomed into street/block level.

If you read the 4.2 version of article about coordinate systems it might be clearer than the one on the website, it has been extensively rewritten.

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

No branches or pull requests

2 participants