New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React-three-fiber compatibility #2
Comments
@LeoPapais strange that you cannot build. I pulled your fork and ran In any case, I'm not very familiar with R3F but I'll take a look at it this week end! |
Stupid question, did you npm install the three types? if you’re using a r3f typescript setup make sure the usage lines up as sometimes the semantics are different depending on weird stuff like if you use an external type vs from three core, which on, If you use import * as THREE etc.. |
Hi All, I'm also interested in this feature.
At least this is what I see that three\examples\js\loaders\OBJLoader.js is doing. |
@DennisSmolek thanks, I forgot to install the @types/three before coming here! After installing the missing types, I kept working on a React component to wrap this loader. Something like that:
I know it's incomplete, but it crashes with the following message:
I'm not sure what's going on here 🤔 |
So the custom progress is clever! From what I can tell the flow makes logical sense and it actually IS a constructor and the usage in RenderDelegate looks correct. have you tried the example vanilla code and then just passing it as a primitive yet? Instead of trying to move all the logic into your hook all at once, get it to work more generically then port the functions over. My guess is something is either firing way early (because… React) and it’s before Three is loaded thus TextureLoader doesn’t exist, thus it isn’t a constructor, or.. Something else in the stack has failed and/or corrupted the Three global object, and what you’re seeing is just the error that finally gets thrown. I would add a bunch of annoying console logs at each stage, it seems you’re getting all the way to do you have a sandbox? are you on the Pmndrs discord? |
Hi there,
Thanks for making this package available, I'm sure that it helps many people out there. I'm currently using R3F to use ThreeJS in a React webpage, so in order to use your package with the useLoader hook, one needs to have the UsdzLoader function names just like the other loaders (for instance, the ObjLoader).
I tried to make a fork to test the changes and create a PR, but I'm facing some issues building it correctly, as the build command throws the following errors:
Do you have any insights on how to solve this issue? Or even patching an R3F-compatible version?
Thanks in advance!
The text was updated successfully, but these errors were encountered: