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

V10 import a 3D object onto Android SDK? #4502

Closed
NickLambert95 opened this issue Jun 14, 2021 · 5 comments
Closed

V10 import a 3D object onto Android SDK? #4502

NickLambert95 opened this issue Jun 14, 2021 · 5 comments

Comments

@NickLambert95
Copy link

I was told in another thread by a Mapbox team member that V10.0 added support for 3D models (like GLTF's) for both native Android and iOS SDK's. I am having trouble finding the documentation for both platforms that showcases an example of how this is actually supposed to be done.

This is the closest I could find for iOS: mapbox/mapbox-maps-ios#154

I cannot find anything like this for Android. Does anyone know where I can find it?

@NickLambert95
Copy link
Author

@tobrun @chloekraw

@astojilj
Copy link

@NickLambert95

I believe you're looking for LocationPuck3D:
Example code: https://docs.mapbox.com/android/beta/maps/guides/migrate-to-v10/#3d-model-capabilities

There is an example in mapbox-maps-android repository. If you face issues with it, or you're interested in other type of models, please submit them to https://github.com/mapbox/mapbox-maps-android.

Note that LocationPuck3D is developed to be used for 3D model of a vehicle. When placed on terrain, based on current position and bearing (modelRotation[2]), it would be additionally rotated (pitch and roll) so that it follows terrain slope.

@NickLambert95
Copy link
Author

@astojilj
Thanks for getting back to me! The example you listed would only allow me to place a single 3D object (and I can't give it a certain location since it uses my current). Is there another method around this for Android? I'm looking to place several 3D models in different locations

@astojilj
Copy link

@NickLambert95
Thanks. I've closed this issue just because of the assumption it is related to LocationPuck3D.
Let's try to clarify requirements for your use case here and eventually open another issue in https://github.com/mapbox/mapbox-maps-android.
We can continue discussion here, no matter that the issue is closed.

For LocationPuck3D, it is possible to specify location https://github.com/mapbox/mapbox-maps-android/blob/5e1a6d358ce7af2783ea226301baa35bf07433fe/plugin-locationcomponent/README.md.

I'm looking to place several 3D models in different locations

a. How complex are the models (number of vertices)? Could you write OpenGL renderer for it?
b. Are the objects to be rendered on 2D map view only, or also on terrain? If on terrain, do all of them follow terrain slope e.g. vehicle or behave like buildings?
c. Are objects moving?
d. Are they placed on ground or above the ground?
e. Currently, custom 3D objects could be rendered using LocationPuck3D or custom layer API. While there are custom layer examples provided with SceneKit on iOS and Three.js on mapbox-gl-js, we have not provided similar example that uses existing framework on Android. Let's visit again what could be done about it. Could you write OpenGL code for the models or use e.g. tinygltf example to load and render? Or prefer some other 3D framework / engine supported on Android, to use in custom layer?

@karatuno
Copy link

@astojilj Can custom layer API be used for 3D markers?

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

3 participants