DEV Community

Discussion on: Svelte-Cubed: Adding Motion to 3D Scenes

Collapse
 
andriusmv profile image
Andres Moreno Vasquez

Is it possible to Load models (GLTF, obj, FBX or similar) into SvelteCubed? if so, how? Thanks! great article!

Collapse
 
alexwarnes profile image
Alex Warnes

Absolutely! Svelte Cubed has a <SC.Primitive /> element you can use to drop any 3d object into. You would use threejs GLTFLoader like usual, and then just pass it to the element like <SC.Primitive object={myGLTFScene} />

For reference, you can add glTF models and see what the the svelte-cubed code looks like using this tool (disclosure, I made it for just this purpose!): sc3-lab.netlify.app