You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The model element uses the file extension of the src URL to determine which loader to use. While this is fine when serving content from a filesystem, it's doesn't work with content dynamically created on demand using languages like PHP.
My initial solution to this problem is to follow the pattern of the <object> tag and add an optional type attribute to the element. This would allow authors to explicitly set the content type of the data by specifying its registered MIME type. Something like this:
Ideally, the model element would also be able to determine object format from the HTTP response Content-Type header, but this is handled by THREE so that would need to be addressed externally.
While this approach will work for models such as gLTF, which has a registered MIME type, it doesn't help with formats like OBJ, which don't have a registered MIME type.
For reference - here are the MIME types for the formats supported so far:
The model element uses the file extension of the
src
URL to determine which loader to use. While this is fine when serving content from a filesystem, it's doesn't work with content dynamically created on demand using languages like PHP.My initial solution to this problem is to follow the pattern of the
<object>
tag and add an optionaltype
attribute to the element. This would allow authors to explicitly set the content type of the data by specifying its registered MIME type. Something like this:Ideally, the model element would also be able to determine object format from the HTTP response
Content-Type
header, but this is handled by THREE so that would need to be addressed externally.While this approach will work for models such as gLTF, which has a registered MIME type, it doesn't help with formats like OBJ, which don't have a registered MIME type.
For reference - here are the MIME types for the formats supported so far:
The text was updated successfully, but these errors were encountered: