sul-dlss / sul-embed

An oEmbed Service for Stanford University Libraries
Other
19 stars 6 forks source link

virtex3d is unmaintained #1486

Closed jcoyne closed 10 months ago

jcoyne commented 1 year ago

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:

jcoyne commented 1 year 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/

edsu commented 12 months ago

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:

  1. Jettison virtex3d and use three.js directly (which is actively maintained, and supports many formats).
  2. Look at converting our obj & mtl files to gltf and then using Google's model-viewer for rendering. It does seem like GLTF is the ascendant format for 3d? Incidentally model-viewer uses three internally, but doesn't provide an interface for the many file format loaders in three. It's not yet clear if we can do this conversion on demand or if we would need to accession the new files into SDR.
  3. It looks like the functionality in virtex3d was folded into UniversalViewer. We could switch to something like that, but it wants to do a lot more than display 3d objects.
  4. Do nothing and keep using virtex3d.
edsu commented 12 months ago

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.

edsu commented 12 months ago

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

edsu commented 11 months ago

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

edsu commented 11 months ago

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.

edsu commented 10 months ago

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/