mapillary / mapillary-js

Interactive, extendable street imagery map experiences in the browser, powered by WebGL

Home Page:https://mapillary.github.io/mapillary-js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Adding GLTFLoader in mapillary.module.js

ClementLeBihan opened this issue · comments

Hi all,

I'm using mapillary-js viewer and I would like to add GLTFLoader in mapillary.module.js, to be able to show 3D models in Three viewer.
I can see many Loader (BufferGeometryLoader, MaterialLoader, AudioLoader, etc) in mapillary.module.js, but nothing to directly import 3D model with texture like ObjectLoader or GLTFLoader as explained here : https://threejs.org/docs/#manual/en/introduction/Loading-3D-models.

I'm not familliar with js, so I was wondering if all this Loader written in mapillary.module.js had been written by hand or can be generate from THREE version ? Otherwise, how to convert THREE ObjectLoader to mapillary.module.js loader ? I would be happy to improve mapillary viewer :)

Best,
Clément

Hi Clement

The Three.js code in mapillary.module.js are internal implementation details only. That being said, you can render any Three.js objects in MapillaryJS by implementing a custom renderer.

Follow the Three.js Custom Renderer guide in the docs. You can see the example running here and the full code by clicking the code button in the top left corner.

Instead of rendering a cube as in the example, load your GLTF model and place it where you want in the MapillaryJS 3D space according to the instructions in the guide.

Great, thank you so much !