Module for spatial annotation of 3D models - looking for advice wrt module structure and approach

Hello,

I am working with my university on a module to allow the display of annotated 3D models within an Omeka S resource page. We also need to be able to add and view annotations associated with coordinates in the 3d scene on the admin site.

This project began in response to a proof of concept I wrote up in SvelteKit using Three.JS. Essentially, each entry was associated with a URI for a 3d model file and a JSON literal describing a list of annotation strings each paired with an xyz coordinate point. The view page would load the points in from the JSON, and a clientside script would display the selected annotation alongside the viewport as the user clicked on each one. The editor page would allow the user to click a point on the model, provide a text input, and then would append the JSON literal in a hidden field before submission.

Crucially, I would like to ensure that this module is as theme- and configuration- agnostic as possible. I would also like to ensure that the annotation data is accessible and mutable from within the admin interface, and that it’s sufficiently associated with each relevant Resource.

I have had success with the following:

  • Creating a custom form for initially submitting the annotation data
  • Creating an ingester/renderer for 3D Model files which allow upload and display of the Model’s media file.

I have hit a bit of a dead end with my naive approach: I was attempting to store the annotation data in a Property of the Resource. At first, I attempted to implement a custom DataType which would render the interactive form/viewer script using the form() and render()/hydrate() functions. However, this is far from theme/configuration agnostic because Omeka S does not use render() or hydrate() when showing values for properties, which i find kind of confusing.

I am brand new to Omeka S and the Laminas framework, and haven’t touched anything PHP in a while. If anyone has advice on how I should approach this project, or can correct some of my assumptions, I would greatly appreciate it!

edit: to clarify, I was under the impression that using items and properties rather than extending the schema was the most “omeka-like” way to do things, but it seems this isn’t the case. I’m looking into extending the data model now.

render() is what gets used when displaying a value as HTML (when asHtml() gets called on the value, which is generally what’s happening when values are shown on pages).

hydrate() is about saving the value.

I’m not sure whether a value is a great fit for what you want to do or not, but that’s how data types work.

1 Like

Okay, I think I understand now! i think there is something wrong with how i had overridden hydrate(). Now render() is outputting properly on the admin and site pages. thank you for pointing that out.