function Rhino3dmLogo({ url, ...props }) {
const model = useLoader(Rhino3dmLoader, url, (loader) => loader.setLibraryPath('/rhino3dm/'))
return <primitive object={model} />
}
always check three docs and examples. the examples can be a bit tough to untangle but they’ll have everything you’re missing if something doesn’t work.
Hey folks! This code pen seems to be broken now. Any ideas on the source? It looks like an error retrieving the Rhino model, but all fo the sources look correct.
i deleted it, both the file and the rhino wasm encoder, because i only have 500mb caps on codesandbox. the code is still valid. just put model and wasm into your public, load it.
you can, if you wanted to. everything can be laid out declaratively if you want to alter individual nodes and meshes easily. you can use gltfjsx as a javascript import and feed it the rhino scene, it will return the jsx scene graph which you can then use via useGraph.
I’ve imported parse from gltfjsx and passed it the object3D returned from Rhino3dmLoader, and I’m not sure what to do with it next, it returns the jsx as a string?
That’s what gltfjsx is for, it extracts the scene graph. Now just remove all the parse stuff, return the jsx and you habe declarative rhino. There’sa hook in Fiber that gives you nodes and materials called useGraph, look for it in the docs.
I’m currently developing a project where I have my own API serving .3dm files. These files are crucial for displaying 3D models in my Next.js application. I’m exploring options to efficiently render these .3dm files directly in Next.js or convert them to .glb format for display.
If anyone has experience or suggestions on how to achieve this effectively within a Next.js environment, or if there are backend adjustments needed to optimize this process, I’d appreciate any insights or guidance you can provide.