donmccurdy / three-gltf-viewer

Drag-and-drop preview for glTF 2.0 models in WebGL using three.js.
https://gltf-viewer.donmccurdy.com/
MIT License
2.09k stars 534 forks source link

wordpress integration #299

Closed sepehrmokhtari closed 2 years ago

sepehrmokhtari commented 2 years ago

how could I use this viewer in WordPress? and if there is not a straightforward way to do this, how can I load textures inside a folder? (Actually, a zip folder to load all gltf and bin and textures)

donmccurdy commented 2 years ago

Hi! This is source code for my viewer shared for use as an example / learning, but it's just deployed as static content here, and I've not made any plans to repackage it for off-the-shelf use in other projects. You might find https://modelviewer.dev/ to be a good solution for that type of use case, also based on three.js.

I would tend to recommend not using .zip archives as resources for viewing on the web. This type of compression is mostly redundant with the types of compression HTTP servers can often provide, and far slower to decompress in JavaScript. If you can 'pack' the files into a .glb (try https://gltf.report/ for this) that is a more efficient and portable option.

sepehrmokhtari commented 2 years ago

Hello :) and Thanks a lot for your advice. I will use .glb format (good points here). Thank you