mapbox-gl-native icon indicating copy to clipboard operation
mapbox-gl-native copied to clipboard

When it will support 3D model?

Open nicolae1992 opened this issue 5 years ago • 38 comments

When it will support 3D GLTF or other formats in mapbox android sdk

Android versions: Device models: Mapbox SDK versions:

nicolae1992 avatar Apr 24 '19 08:04 nicolae1992

This is something we are thinking about exposing an API around though atm can't give you a concrete eta. The formats are still TBD but ideally it would be an open format. We will follow up with more concrete issues in the near future, closing this issue as answered for now.

tobrun avatar Apr 29 '19 09:04 tobrun

@tobrun Is there anywhere where we can vote to prioritise that feature? We are using mapbox and will need 3d map annotations very soon.

Both Android and iOS version.

noway avatar Jun 27 '19 23:06 noway

@noway Thx, This task is very important

nicolae1992 avatar Aug 26 '19 21:08 nicolae1992

@noway @nicolae1992

mapbox-gl-js demo https://bl.ocks.org/ryanbaumann/b9725e79b5b1742d92ada00ddbf5c3d3 uses Three.js for loading GLTF model. We don't plan to include GLTF model loader to mapbox code - hopefully you were able to find a loader to use. Please notify if following similar approach (custom layer e.g. https://github.com/mapbox/mapbox-gl-js/pull/7977 and https://bl.ocks.org/ryanbaumann/b9725e79b5b1742d92ada00ddbf5c3d3) doesn't work for you.

astojilj avatar Aug 27 '19 09:08 astojilj

@astojilj this link is js, but needed for Android SDK

nicolae1992 avatar Aug 27 '19 10:08 nicolae1992

@astojilj this link is js, but needed for Android SDK

Yes, mapbox-gl-js demo is useful to explain the approach: similarly, you'd need to load GLTF model using loader of your choice and use custom layer approach, as mentioned in https://github.com/mapbox/mapbox-gl-native/issues/14494#issuecomment-525216947

astojilj avatar Aug 27 '19 13:08 astojilj

@astojilj I'm using mapbox for react native, so ideally I need the 3d model layer support in react-native-mapbox-gl/maps package. I assume it would be something along the lined of

<MapboxGL.MapView>
  <MapboxGL.ThreeDLayer shape={shape} meshes={meshes}>
  </MapboxGL.ThreeDLayer>
</MapboxGL.MapView>

or something similar. I don't think I have capacity to build that feature out for react-native-mapbox-gl/maps package by my own. I heard that you guys are not supporting this package, so it might be on @nitaliano to port this to RN world. A fully figured out and documented Android/iOS support though is a good first step. I'm not sure if your mapbox-gl-js example would work for mapbox-sdk-ios/mapbox-sdk-android as it is?

noway avatar Aug 27 '19 14:08 noway

@astojilj this link is js, but needed for Android SDK

Yes, mapbox-gl-js demo is useful to explain the approach: similarly, you'd need to load GLTF model using loader of your choice and use custom layer approach, as mentioned in #14494 (comment)

Hi, I have found a java loader to load GLTF model. But now I need the documentation of custom layer approach for android SDK. I couldn't find how to custom layer with android, so is there any documentation about this?

luckkyzhou avatar Mar 04 '20 00:03 luckkyzhou

@tobrun Has there been an update on 3D objects in android yet? We're trying to put 3D cars on our map and have successfuly achieved it through the web gl but not on android or iOS

NickLambert95 avatar Apr 13 '20 01:04 NickLambert95

Can this be reopened?

noway avatar Apr 25 '20 04:04 noway

cc @chloekraw

tobrun avatar Apr 28 '20 06:04 tobrun

Hi folks, thanks for all your interest in this feature. Support for 3D objects is something we are exploring; there's no timeline for its release. We'll keep you posted.

chloekraw avatar Apr 28 '20 16:04 chloekraw

Hi folks, thanks for all your interest in this feature. Support for 3D objects is something we are exploring; there's no timeline for its release. We'll keep you posted.

Hey @chloekraw not to be rude but this is the exact same answer we've heard over a year ago. Is there any updates on this? There are a lot of benefits and uses this feature can bring and we really need this for our app. Are there any work arounds that may accomplish this?

Thanks

NickLambert95 avatar May 08 '20 05:05 NickLambert95

@chloekraw @nicolae1992 @NickLambert95

I have finished loading 3d model with mapbox gl native, implement a custom layer that loads the 3D model, referencing the assimp library.

@NickLambert95 You could check out my comment:

https://github.com/mapbox/mapbox-gl-native/issues/13157#issuecomment-608253844

leedejun avatar Jul 28 '20 08:07 leedejun

@chloekraw @nicolae1992 @NickLambert95

I have finished loading 3d model with mapbox gl native, implement a custom layer that loads the 3D model, referencing the assimp library.

@NickLambert95 You could check out my comment:

#13157 (comment)

Hey @leedejun how exactly did you do this? Can I see your code that you edited? Thanks

NickLambert95 avatar Aug 07 '20 00:08 NickLambert95

Hi @leedejun, Could you please share the code you wrote to achieve 3D object layers for iOS and Android? We need the same feature and there's no update for any official support for more than a year. Any help appreciated. Thank you!

janweigel avatar Sep 23 '20 13:09 janweigel

@janweigel He never got back to me either but it appears he made this in React Native (which is the web version of mapbox)

NickLambert95 avatar Sep 23 '20 13:09 NickLambert95

@janweigel He never got back to me either but it appears he made this in React Native (which is the web version of mapbox)

React Native does not use the web version of mapbox afaik

patrickkempff avatar Sep 23 '20 16:09 patrickkempff

@patrickkempff Maybe not react native then. The mapbox GL version (which works on web) allows you to add GLTF files as 3D models. There isn't a workaround I'm aware of for iOS and Android

NickLambert95 avatar Sep 23 '20 20:09 NickLambert95

If I get the post of @leedejun correctly then he modified the c++ code to add that feature to the native android and ios version and not the gl js version of mapbox. That's exactly what I'm looking for.

janweigel avatar Sep 23 '20 22:09 janweigel

@janweigel Yeah I desperately need that function too. Let me know if he ever gets back to you and I'll do the same for you

NickLambert95 avatar Sep 23 '20 22:09 NickLambert95

Hi, @patrickkempff @NickLambert95 @janweigel

I understand your problem, I solved it. I achieved it by modifying the custom layer of mapbox gl native in Mac, linux, android, windows, and used the Assimp library.

But I can't share my code, I wish share my code after I leave the current company. I would like share my method with you. the method detail:

  1. The Assimp is able to read the model files;
  2. Add a function for Convert latitude and longitude to Opengl coordinates, Rang: [-1.0,1.0] ;
  3. Implement mapbox custom layer to draw 3d model.

leedejun avatar Sep 24 '20 01:09 leedejun

Hi @leedejun, Thanks for sharing that info. I'll see if I can implement the native part for a custom layer myself.

It would be even better if this would be part of the official mapbox native code.

janweigel avatar Sep 25 '20 22:09 janweigel

Hi @janweigel @leedejun Thanks for the information. It would be helpful if anyone share the snippet for, custom layer to draw 3d model using mapbox native code.

Thanks in advance

Amrutha1991 avatar Nov 17 '20 07:11 Amrutha1991

It'd be even more useful if the code was shared with Mapbox, so @chloekraw can implement this officially

fabdrol avatar Nov 23 '20 22:11 fabdrol

Anyone have an update on this topic? Any solutions? @janweigel @fabdrol @patrickkempff @tobrun @luckkyzhou @leedejun @chloekraw

NickLambert95 avatar Dec 08 '20 03:12 NickLambert95

Also requesting 3D model support on iOS and Android.

Cal-um avatar Dec 08 '20 12:12 Cal-um

@NickLambert95 and @Cal-um We switched to Unity using the Mapbox Unity SDK, as it wasn't possible to wait for those features.

janweigel avatar Dec 08 '20 15:12 janweigel

@janweigel Oh I see. Out of curiosity does Mapbox Unity come with the same navigation features? As in, could I build a full fledge app with the navigation SDK and directions API in it? I looked this up before but couldn't find any information as to whether Unity supported it

NickLambert95 avatar Dec 08 '20 17:12 NickLambert95

that's a good shout. Probably better for my use case as well. Just need to learn unity 😂

Cal-um avatar Dec 09 '20 09:12 Cal-um