Closed jcoyne closed 10 months ago
It's possible that we could use https://modelviewer.dev/
. In order to do this I had to convert the object object to use a library:
npm install -g obj2gltf
Then we can create a gltf derivative:
obj2gltf -i bb648mk7250_low.obj
I was able to load this derivative into the sandbox at https://modelviewer.dev/editor/
Not knowing much about the 3D objects in SDR I was curious about the file formats we are displaying with virtex3d.
I used Argo to generate a report for all items that have content type "3D". I exported the metadata for the 446 items as a CSV. 130 of these have zero files, and were never released (e.g. cd935cv6455, which leaves 316 items.
I fetched the Cocina for the 316 and listed out the filenames in the structrual metadata, and then counted the number of file extensions:
Extension | Count |
---|---|
obj | 315 |
mtl | 315 |
jpg | 243 |
tar | 112 |
zip | 100 |
ply | 75 |
stl | 1 |
json | 1 |
So it looks like obj and mtl files are being used, and the Virtex viewer is initalized witht he .obj
file URL. It looks like virtex3d is mostly a shim around three.js.
It seems like we can:
I'm going to proceed with doing some research for 2 (adding GLTF files for these objects). I'd like to create a comparison view of the objects we have, and let a curator take a look to see if there are any noticeable differences we should care about. Then I would like to come up with a plan for how to update them, if it does look like a viable way forward.
@thatbudakguy brought up the good point that based on how many 3D objects we might expect to be getting in the future we may want to consider creating GLTF derivatives during accessioning.
After discussion during standup I will try to bend @andrewjbtw's ear to get his take on the proposed way forward, and especially to see if there are any stakeholders interested in 3D content.
@andrewjbtw suggested I get in touch with @calavano to see what he thinks about the idea of converting our OBJ files to GLTF. He was open to the idea of exploring how viewing GLTF files compares with viewing OBJ files with vertex3d. He mentioned that the faculty member in Archaeology who was most active in depositing 3D scans is no longer at Stanford, but there is a new faculty member there who has expressed interest. Tony expects to see about 12 objects scanned per year from him.
I am going to proceed by creating a small static site that lets Tony (and others) inspect and compare both versions of world viewable 3d objects in SDR.
Tony mentioned a few things that will be important to keep in mind:
I've added a check list of work that needs to be done to the initial description, to help people understand what's going on without requiring them to digest the comments.
In case anyone wants to find it after the fact, the static site evaluation of virtex3d and model-viewer can be found at https://sul-dlss-labs.github.io/3d-eval/ and is also in git at https://github.com/sul-dlss-labs/3d-eval/ The items on display are only the public ones.
The notes and code that were used to convert the files for all production items, and create a spreadsheet for accessioning them with Preassembly can be found at https://github.com/sul-dlss-labs/3d-conversion/
We should switch to something that is maintained.
After some prototyping and experimentation (see below) and consultation with @calavano and @andrewjbtw we can move forward using model-viewer. We are not going to modify assemblyWF at this time, and will migrate the existing OBJ files to GLB (GLTF), and update them.
Maybe these should be separate tickets but it seems easier just to list the sub-tasks here: