jscastro76 / threebox

A Three.js plugin for Mapbox GL JS, with support for animations and advanced 3D rendering.
Other
549 stars 145 forks source link

How to add a sprite. #393

Closed alienatorZ closed 1 year ago

alienatorZ commented 1 year ago

How would I use a sprite within threebox.

I tried this (replacing the basic example sphere):

const smap = new THREE.THREE.TextureLoader().load( 'icon.png' ); const material = new THREE.THREE.SpriteMaterial( { map: smap } );

const sprite = new THREE.THREE.Sprite( material ); tb.add(sprite);

But I am not seeing it on the map. Is there an example of this. I am trying to work around the lack of marker altitude in Mapbox.

Thanks!

alienatorZ commented 1 year ago

I figured this out but adding a transparent model to the map and adding a label to it.