-
Notifications
You must be signed in to change notification settings - Fork 0
Modelos 3D
🇬🇧 English first · 🇪🇸 Español más abajo.
Only the models actually used are bundled (the repo stays light, ~17 MB):
| File | Used in | Size |
|---|---|---|
hamburger__food_big-hamburger.glb |
La Picante + About | 6.3 MB |
hamburger__game_asset.glb |
La Veggie | 3.4 MB |
tripo-hamburgers_generated_by_ai.glb |
La Clásica | 7.1 MB |
All in GLB format (binary glTF with embedded textures), downloaded from Sketchfab under Creative Commons licenses.
- Free Sketchfab account.
- Search the model → filter by Downloadable + Free.
- Download in GLB format.
- Copy it into
public/. - Reference the path in the component (
/my-model.glb).
Other sources: poly.pizza, Fab, Khronos glTF Sample Assets.
useGLTF caches and returns a single instance of the model. A Three.js 3D object can only be mounted at one point in the scene graph.
❌ Without cloning: if two cards use the same .glb, they share the object → one stays empty and the scale calculations collide.
✅ With cloning:
const { scene } = useGLTF(path)
const model = useMemo(() => scene.clone(true), [scene])Each instance gets its own copy → the same model can be reused without conflicts.
Each model comes at a different scale and sometimes includes extra geometry (a plate, fries, a base). To make all burgers appear the same size:
const box = new THREE.Box3().setFromObject(cloned)
box.getCenter(center); box.getSize(sizeV)
cloned.position.sub(center) // center
const maxDim = Math.max(sizeV.x, sizeV.y, sizeV.z)
cloned.scale.setScalar(targetSize / maxDim) // normalizeSolo se incluyen los modelos realmente usados (el repo se mantiene ligero, ~17 MB):
| Archivo | Uso | Tamaño |
|---|---|---|
hamburger__food_big-hamburger.glb |
La Picante + About | 6.3 MB |
hamburger__game_asset.glb |
La Veggie | 3.4 MB |
tripo-hamburgers_generated_by_ai.glb |
La Clásica | 7.1 MB |
Todos en formato GLB (glTF binario, con texturas embebidas), descargados de Sketchfab bajo licencias Creative Commons.
- Cuenta gratuita en Sketchfab.
- Buscar el modelo → filtrar por Downloadable + Free.
- Descargar en formato GLB.
- Copiar a
public/. - Referenciar la ruta en el componente (
/mi-modelo.glb).
Otras fuentes: poly.pizza, Fab, Khronos glTF Sample Assets.
useGLTF cachea y devuelve una única instancia del modelo. Un objeto 3D de Three.js solo puede montarse en un punto del grafo de escena.
❌ Sin clonar: si dos tarjetas usan el mismo .glb, comparten el objeto → una queda vacía y los cálculos de escala se pisan.
✅ Con clonar:
const { scene } = useGLTF(path)
const model = useMemo(() => scene.clone(true), [scene])Cada instancia tiene su propia copia → se puede reutilizar el mismo modelo sin conflictos.
Cada modelo viene en una escala distinta y a veces incluye geometría extra (un plato, papas, una base). Para que todas las hamburguesas se vean del mismo tamaño:
const box = new THREE.Box3().setFromObject(cloned)
box.getCenter(center); box.getSize(sizeV)
cloned.position.sub(center) // centrar
const maxDim = Math.max(sizeV.x, sizeV.y, sizeV.z)
cloned.scale.setScalar(targetSize / maxDim) // normalizar