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
Given some circumstances, my code will not have "ordinary" URLs of the 3D files I would like to include with the various loaders (useLoader with GLTFLoader or STLLoader seems to work fine with normal URLs in my tests), but object URLs.
In the following example, the object URL is created from a file chosen locally (URL.createObjectURL(file)).
Rough example code:
This somewhat expectedly does not work, the loader fails to parse (e.g. tons of warnings in the console, THREE.OBJLoader: Unexpected line: " and then various non-ascii characters).
However, it is not clear to me what the right way would be to go from these Object URLs to whatever useLoader accepts – any idea would be appreciated.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Given some circumstances, my code will not have "ordinary" URLs of the 3D files I would like to include with the various loaders (
useLoader
withGLTFLoader
orSTLLoader
seems to work fine with normal URLs in my tests), but object URLs.In the following example, the object URL is created from a file chosen locally (
URL.createObjectURL(file)
).Rough example code:
App.tsx
Viewer3D.tsx
ThreeViewer.tsx
This somewhat expectedly does not work, the loader fails to parse (e.g. tons of warnings in the console,
THREE.OBJLoader: Unexpected line: "
and then various non-ascii characters).However, it is not clear to me what the right way would be to go from these Object URLs to whatever
useLoader
accepts – any idea would be appreciated.Beta Was this translation helpful? Give feedback.
All reactions