Hi, everyone,
I’m working on a “student project” with my team, a chat with 3D avatars.
It’s my first time working with Three.js, and React Three Fiber.
I’m responsible for the 3D because my last project was a game with Unity.
I found some really nice avatar in the Unity Asset Store, but before paying for that, I wanted to try with Free “monsters” first.
I could export the file with one monster and now I’m lost because there is so many different files.
Also, VS CODE has an extension to preview .fbx files, but it’s loading forever…
Is the .meta file, next to the .fbx file, important to use the .fbx …?
For the moment, I could only add some cubes to my project, so I’m happy, three.js works well with react but I don’t want cubes^^.
So my question is, how to make sure to have the right .fbx file, and how to add the materials and the animations to it…?
I tried to read about FBX2glTF. The name is clear, but the tutorial explain you to convert Fbx to Glb …
Where is the .gltf part in all this?
I’m lost, but I can’t give up on this…
EDIT: I didn’t read correctly, or it’s maybe not explained so well… with " -b " it makes .glb files, but alone it makes .gltf, so everything is ok !
Just need to implement it in my project and then everything is perfect !
Note that glb is just the binary version of gltf. You’d be better off using glb files, because as it’s binary it’s smaller and it embed all your textures, whereas gltf files don’t.
You can load glb files with THREE.GLTFLoader the same way you do with gltf.
Thank you for that!
It works now, I don’t really know why, but I have my object.
My new problem is that, there is no colors, the textures are in the same files, but I guess FBX2glTF only kept the object, without reference to the textures…?
Any idea how to fix this problem…?
Try uploading your glb to this three.js-based web viewer : https://gltf-viewer.donmccurdy.com
If it has textures then it’s an issue with your three.js code, if not it’s an issue with FBX2glTF.
You can also import a glb/gltf file in Blender, and check the materials associated with your model.
My glb is just gray…
In VSCode, I could add the texture with TextureLoader, But it’s a big mess… The object now is some kind of blue turtle with spikes on the shell, a bit like in Mario… And now it’s colorful, but it only looks like stains ^^
Can I use Blender to add correctly the textures, and then export as a new .glb file?
If not, how to fix the texture with code? And how to add many textures to the same object?
I propably do it wrong since it’s the first time I use Blender.
But I can take my object, add the texture perfectly, but when I export as glTF/glb, when I try it in the three.js editor, it’s still gray.
Yes, the material changed, but just the name.
I would love to know how to make a complete object (textures + animations) to export as .glb
Anyway I could find on another topic how to apply the textures correctly: texture.flipY = false;
‘Is the .meta file, next to the .fbx file, important to use the .fbx …?’
The meta file is just for unity to keep track of files within a project it doesn’t have anything to do with the model being used outside of unity.
As Mugen said Sketchfab or similar might be an easier to work from source? Also not sure on if you have a public deliverable / how hot your Uni is on complying with asset licences but if you need to stick it up on web then you might be better with CC-BY-A licenced assets rather than Unity assets store ones.