Rotate & Moving 3D Model in MapLibre #1548
Replies: 5 comments
-
Does https://maplibre.org/maplibre-gl-js-docs/example/add-3d-model/ help you? |
Beta Was this translation helpful? Give feedback.
-
@wipfli Thank you, I started with this example but now I'm looking at how I combine ThreeJs and MapLibre to rotate and move my 3D model I was using this code to make my model move but only according to the two origins variables. I'm trying to make it more precise by navigating with the mouse `
document.getElementById('move').addEventListener('click', function () {
` |
Beta Was this translation helpful? Give feedback.
-
You can use ThreeJS with MapLibre for sure. The way you do it is to place the ThreeJS scene origin using the method shown in the 3D model example and then using ThreeJS's own methods to place the 3D models relatively to the origin. If you need to use coordinates for the models' locations, first perform conversion calculations of the distances between the target locations and the scene origin coordinates and then apply the correct transforms to the models. |
Beta Was this translation helpful? Give feedback.
-
Is there an issue here or should this be converted to a discussion? |
Beta Was this translation helpful? Give feedback.
-
Discussion would indeed be a better place for this. I do not think there are any issues with this. |
Beta Was this translation helpful? Give feedback.
-
I would to know if it is possible to rotate and move a 3D model added on a maplibre map.
I would like to see your examples.
Beta Was this translation helpful? Give feedback.
All reactions