Hello guys, I am new to threejs and i need some help to load .stl and 3mf files.
I am using react-three-fiber package in my React application.
Here is my code: stl file is logged as bufferGeometry, but it didn’t render on the screen. Could anyone please help me what is wrong in the below code?
geometry or materials alone do nothing, they’re technically not even 3d scene objects. always must be used in a mesh. as for the <primitive object={geom} attach="geometry" />, it would work but why, you have a geometry, just use mesh.geometry just like you would in plain three. primitive is when you have a foreign object or scene that you would need to put into the canvas.
if it didnt work the link doesnt work, 404, file broken, model too big or too small, camera facing the other way, it can have many reasons now. i’d start with chrome devtools > networking to see if it actually loaded.
as i said, it can have lots of reasons now, some trivial, like camera positioning. make a small codesandbox if you like, it’s impossible to help from here on otherwise.