docs icon indicating copy to clipboard operation
docs copied to clipboard

Add a 3d model viewer

Open fire opened this issue 4 years ago • 6 comments

I would be able to have both static previews and 3d previews in Teddy (like www.sketchfab.com)

Visualization of different 3d file formats:

  • GLTF2 (Works both in three.js and Godot Engine as a webpage)
  • FBX via fbx2gltf2 (I have patches for better support.) https://github.com/revolufire/FBX2glTF/releases/tag/v2019-12-25T15_23-08_00
  • stl can be easily converted to gltf2
  • obj can be easily converted to gltf2

fire avatar May 24 '20 23:05 fire

google modelviewer package could be usefull: https://modelviewer.dev/ .

NektariosFifes avatar May 25 '20 21:05 NektariosFifes

the viewer from google looks really impressive. But the conversion of file formats is a problem. I am working a lot with STL files for 3d printing and lasercutting for example. Having some files about 500 mb sometimes. Conversion would destroy its original purpose and would create extra load. a native support would be the better approach

but supporting the formats to display i'd like too

vmario89 avatar May 29 '20 17:05 vmario89

And also the files need to be read server-side to create a thumbnail, which is no small task.

jendib avatar May 29 '20 17:05 jendib

And also the files need to be read server-side to create a thumbnail, which is no small task.

https://modelviewer.dev/examples/tester.html . Here there is the option to create poster. This could be used for thumbnail.

NektariosFifes avatar May 31 '20 08:05 NektariosFifes

regarding to this topic, gitea added some easy support for this(STL file format only). Just by adding Madeleine.js like the following:

  • https://docs.gitea.io/en-us/customizing-gitea/ (look for section "STL Preview")
  • https://gitea.fablabchemnitz.de/MarioVoigt/STL-Test/src/branch/master/Unicorn.stl

for bulk handling STL files inside a Teedy instance maybe this can help (i can not really help. i am not a Java or JavaScript/node.js software dev) :/

vmario89 avatar Aug 12 '20 17:08 vmario89

Madeleine.js only supports STL files however, but yes it seems easy enough

jendib avatar Aug 12 '20 17:08 jendib