Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial implementation of a X3D previewer with the X_ITE library #56

Merged
merged 10 commits into from
May 3, 2024

Conversation

PaulBoon
Copy link

@PaulBoon PaulBoon commented Apr 20, 2024

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 #55

Example (screendump):

Screenshot from 2024-04-20 15-04-17

Tips for testing:
Use the famous teapot model:
https://www.web3d.org/x3d/content/examples/Basic/CAD/CadTeapot.x3d

@pdurbin
Copy link
Member

pdurbin commented Apr 22, 2024

@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:

@qqmyers
Copy link
Member

qqmyers commented Apr 22, 2024

@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.

@landreev
Copy link

@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"?

@PaulBoon
Copy link
Author

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.

@qqmyers
Copy link
Member

qqmyers commented Apr 29, 2024

@PaulBoon - just use /previewers/betatest - I'll copy everything there to a 1.5 dir when we release a new version.

@PaulBoon PaulBoon marked this pull request as ready for review May 3, 2024 13:09
@PaulBoon
Copy link
Author

PaulBoon commented May 3, 2024

OK, I fixed some things so now it should work with more mimetypes:

  • model/x3d+xml
  • model/vrml
  • model/gltf-binary
  • model/obj
  • model/stl
  • model/x-ply

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.

Copy link
Member

@qqmyers qqmyers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the minor changes requested and if you OK my doc edits, I'll go ahead and merge this. That will make it available in the betatest dir from github.io so it will be easier for people to try and do any QA.

@PaulBoon
Copy link
Author

PaulBoon commented May 3, 2024

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

@PaulBoon
Copy link
Author

PaulBoon commented May 3, 2024

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.

@qqmyers
Copy link
Member

qqmyers commented May 3, 2024

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!

@qqmyers qqmyers merged commit 3f1d4fa into gdcc:develop May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants