Closed PaulBoon closed 3 months ago
@PaulBoon thanks for the pull request! I'm not sure if you say my post on the google group, but we are definitely in the market for a 3D viewer! Please see also:
@PaulBoon - in terms of a PR - the v1.4 previewers dir is intended to be frozen (so that people deploying from the gdcc repo don't see any changes). If you make your changes in the betatest dir, they are available once merged, and will also get added to the 1.5 version when that comes out.
@PaulBoon very cool! In addition to "contentType":"model/x3d+xml"
, do you think this previewer could be used on all, or any of the other formats listed at https://create3000.github.io/x_ite/ under "Supported File Formats"?
Thanks for those positive comments, I will update my 'Draft' to use a 1.5 directory and have a look at more types + test with larger models.
@PaulBoon - just use /previewers/betatest - I'll copy everything there to a 1.5 dir when we release a new version.
OK, I fixed some things so now it should work with more mimetypes:
I moved the 'code' to the 'betatest' folder, but those curl calls reference 1.4
, so you would have to move the to the 1.4 folder when testing or change that curl.
After downloading some example files for testing those mimetypes, I discovered that the preview does not always render them optimally. My expectations for a good previewer are that the initial rendering of a loaded file does try to let me see the model, by manipulating the viewport and lighting etc. for me. This does not always work, sometimes the model is far away, and I have to zoom in first. Other times the model is out of sight completely or the shading isn't helpful.
Downloaded sample files from MeshLab at: https://www.meshlab.net/data/sample_meshes.zip For glTF files I found this: https://github.com/KhronosGroup/glTF-Sample-Models/blob/main/2.0/README.md
I just downloaded MRIPAS_coll_170974_VulpesVulpes_2017_F_jaw_scan3D.stl
from https://dataverse.openforestdata.pl/dataset.xhtml?persistentId=doi:10.48370/OFD/Y8TNUO.
This DV has a 3D viewer.
If I use the X3Dviewer I have to zoom out first, but then it renders fine.
OK - I'll merge to make it easier for people to test. If there's further work to set a useful initial default view or something, just create a new PR. Thanks for the viewer - lots of people are interested!
Adds a previewer for the x3d format (mime type: model/x3d+xml) using the X_ITE library. Using that library potentially many other formats can be rendered. Other libs I tried where x3dom and three.js, X_ITE was the simplest to use.
Solves part of https://github.com/gdcc/dataverse-previewers/issues/55
Example (screendump):
Tips for testing: Use the famous teapot model: https://www.web3d.org/x3d/content/examples/Basic/CAD/CadTeapot.x3d