Closed theo-armour closed 4 years ago
It's published in the public npm
repository so yes, a CDN like jsdelivr.net or unpkg.com that proxies npm modules should work.
More specifically, for usage with globals, you'll probably want the textmesh-standalone umd file with its two dependencies:
https://cdn.jsdelivr.net/npm/troika-three-utils@0.26.0 https://cdn.jsdelivr.net/npm/troika-worker-utils@0.26.0 https://cdn.jsdelivr.net/npm/troika-3d-text@0.26.0/dist/textmesh-standalone.umd.min.js
You should then be able to access the global troika_3d_text.TextMesh
I haven't tried this personally so lemme know if it doesn't work.
@lojjic
Thanks for speedy holiday reply. looking now.
@lojjic
https://ta-troika-3d-text.glitch.me/
source: https://glitch.com/edit/#!/ta-troika-3d-text?path=index.html%3A1%3A0
see line 228
error Uncaught Reference Error: TextMesh is not defined
Yeah, like I wrote above if you're using globals then it's going to be at troika_3d_text.TextMesh
not just TextMesh
. Your glitch seems to work when you fix that and the missing argument to zoomObjectBoundingSphere.
Also keep in mind that the text layout is asynchronous, so the bounding sphere won't be accurate until after the sync completes.
Again. @lojjic, thank you for speedy holiday response.
My doh. Troika 3D Text rules!
Your project looks like it is going to be fun to investigate
Is troika-3d-text available via a content delivery network such as jsdelivr.net?
I build very simple plain-vanilla JavaScript cookbook examples - such as this one:
https://www.ladybug.tools/spider-covid-19-viz-3d/cookbook/globe-population-cities/
I am very interested in building examples that include troika-3d-text. Is there some way this could be possible?