# Banana

> A low-poly banana built from pentagonal tapered segments along a gentle curve, with a woody neck and stem cap and a dark blossom tip. Show a single banana or a hand of five joined at the crown, and pick green, ripe or spotted ripeness. Real-world size (about 19 cm long), scalable for oversized pickups in jungle, tropical and farm games.

![Banana preview](https://codels.download/m/banana.png)

Multi-view sheet (3/4, front, side, top): https://codels.download/m/banana.sheet.png

## Facts

- Category: Food & Drink › Fruits & Vegetables
- Size (W × H × D): 0.20 × 0.05 × 0.03 m — units are meters, +Y up, front faces +Z
- Origin: center of the base (y = 0)
- Triangles: 210 · Meshes: 11 · Materials: 4
- License: CC0-1.0 (Codels built-in)
- Tags: banana, fruit, cartoon, low-poly, stylized, farm, kitchen, tropical, jungle, farming-sim, platformer, survival, collectible, food, pickup, prop, organic, game-ready, instancing-friendly, mobile-friendly, parametric, color-yellow, size-tiny, poly-ultra-low
- Page: https://codels.download/models/banana

## Files

| Format | URL |
|---|---|
| three.js ES module (`createBanana()`) | https://codels.download/m/banana.js |
| React Three Fiber component (`<Banana />`) | https://codels.download/m/banana.jsx |
| Instancing module (`createBananaInstances(count, place)`, one draw call per material) | https://codels.download/m/banana.instanced.js |
| Standalone HTML demo | https://codels.download/m/banana.html |
| glTF binary | https://codels.download/m/banana.glb |
| glTF binary, Meshopt-compressed (2–3× smaller; GLTFLoader needs `setMeshoptDecoder(MeshoptDecoder)`) | https://codels.download/m/banana.glb?compress=meshopt |
| glTF JSON | https://codels.download/m/banana.gltf |
| OBJ (vertex colors) + MTL | https://codels.download/m/banana.obj · https://codels.download/m/banana.mtl |
| STL | https://codels.download/m/banana.stl |
| CodelSpec JSON | https://codels.download/m/banana.json |

## Parameters

Append them as query parameters to any URL above to get a customized variant (e.g. `?style=...`).

| Param | Type | Range / options | Default | Current |
|---|---|---|---|---|
| `style` | select | single \| bunch | single | single |
| `ripeness` | select | green \| ripe \| spotted | ripe | ripe |
| `size` | number | 0.08 – 0.6 | 0.19 | 0.19 |

## Parts

- banana (group)
  - bananaSeg1 (cylinder · neck)
  - bananaSeg2 (cylinder · peel)
  - bananaSeg3 (cylinder · peel)
  - bananaSeg4 (cylinder · peel)
  - bananaSeg5 (cylinder · peel)
  - bananaSeg6 (cylinder · peel)
  - bananaSeg7 (cylinder · peel)
  - bananaSeg8 (cylinder · peel)
  - bananaSeg9 (cylinder · peel)
  - bananaStem (cylinder · crown)
  - bananaTip (cone · tip)

## How to use

Save the code below as `banana.js`, then:

```js
import { createBanana } from './banana.js';
const model = createBanana();
scene.add(model);
```

## Code

```js
/**
 * Banana — Codels 3D model library (https://codels.download/models/banana)
 * License: CC0-1.0 · Units: meters · Y-up · Front: +Z · Origin: center of the base (y = 0)
 * Triangles: 210 · Size (W × H × D): 0.20 × 0.05 × 0.03 m
 *
 * Usage:
 *   import { createBanana } from './banana.js';
 *   
 *   const model = createBanana();
 *   model.position.set(0, 0, 0);
 *   scene.add(model);
 */
import * as THREE from 'three';

const deg = THREE.MathUtils.degToRad;

export function createBanana() {
  const root = new THREE.Group();
  root.name = 'Banana';

  // Materials
  const peelMat = new THREE.MeshStandardMaterial({ name: 'peel', color: 0xf6d33a, roughness: 0.55, flatShading: true });
  const neckMat = new THREE.MeshStandardMaterial({ name: 'neck', color: 0xb6b83e, roughness: 0.7, flatShading: true });
  const tipMat = new THREE.MeshStandardMaterial({ name: 'tip', color: 0x3d2a1c, roughness: 0.9, flatShading: true });
  const crownMat = new THREE.MeshStandardMaterial({ name: 'crown', color: 0x7d6a3a, roughness: 0.9, flatShading: true });

  // Shared geometries
  const cylinderGeo = new THREE.CylinderGeometry(0.018, 0.018, 0.0276, 5);

  // Parts
  const banana = new THREE.Group();
  banana.name = 'banana';
  banana.position.set(-0.085, 0.0428, 0);
  root.add(banana);
  const bananaSeg1 = new THREE.Mesh(new THREE.CylinderGeometry(0.0103, 0.0055, 0.0248, 5), neckMat);
  bananaSeg1.name = 'bananaSeg1';
  bananaSeg1.position.set(0.0093, -0.0049, 0);
  bananaSeg1.rotation.set(0, 0, deg(-117.9));
  banana.add(bananaSeg1);
  const bananaSeg2 = new THREE.Mesh(new THREE.CylinderGeometry(0.0148, 0.0103, 0.0265, 5), peelMat);
  bananaSeg2.name = 'bananaSeg2';
  bananaSeg2.position.set(0.0285, -0.0137, 0);
  bananaSeg2.rotation.set(0, 0, deg(-111.0111));
  banana.add(bananaSeg2);
  const bananaSeg3 = new THREE.Mesh(new THREE.CylinderGeometry(0.018, 0.0148, 0.0276, 5), peelMat);
  bananaSeg3.name = 'bananaSeg3';
  bananaSeg3.position.set(0.0486, -0.02, 0);
  bananaSeg3.rotation.set(0, 0, deg(-104.1222));
  banana.add(bananaSeg3);
  const bananaSeg4 = new THREE.Mesh(cylinderGeo, peelMat);
  bananaSeg4.name = 'bananaSeg4';
  bananaSeg4.position.set(0.0693, -0.0239, 0);
  bananaSeg4.rotation.set(0, 0, deg(-97.2333));
  banana.add(bananaSeg4);
  const bananaSeg5 = new THREE.Mesh(cylinderGeo, peelMat);
  bananaSeg5.name = 'bananaSeg5';
  bananaSeg5.position.set(0.0903, -0.0253, 0);
  bananaSeg5.rotation.set(0, 0, deg(-90.3444));
  banana.add(bananaSeg5);
  const bananaSeg6 = new THREE.Mesh(cylinderGeo, peelMat);
  bananaSeg6.name = 'bananaSeg6';
  bananaSeg6.position.set(0.1114, -0.0242, 0);
  bananaSeg6.rotation.set(0, 0, deg(-83.4556));
  banana.add(bananaSeg6);
  const bananaSeg7 = new THREE.Mesh(new THREE.CylinderGeometry(0.0176, 0.018, 0.0274, 5), peelMat);
  bananaSeg7.name = 'bananaSeg7';
  bananaSeg7.position.set(0.1321, -0.0205, 0);
  bananaSeg7.rotation.set(0, 0, deg(-76.5667));
  banana.add(bananaSeg7);
  const bananaSeg8 = new THREE.Mesh(new THREE.CylinderGeometry(0.0127, 0.0176, 0.0257, 5), peelMat);
  bananaSeg8.name = 'bananaSeg8';
  bananaSeg8.position.set(0.1523, -0.0144, 0);
  bananaSeg8.rotation.set(0, 0, deg(-69.6778));
  banana.add(bananaSeg8);
  const bananaSeg9 = new THREE.Mesh(new THREE.CylinderGeometry(0.0045, 0.0127, 0.0227, 5), peelMat);
  bananaSeg9.name = 'bananaSeg9';
  bananaSeg9.position.set(0.1716, -0.0059, 0);
  bananaSeg9.rotation.set(0, 0, deg(-62.7889));
  banana.add(bananaSeg9);
  const bananaStem = new THREE.Mesh(new THREE.CylinderGeometry(0.0068, 0.006, 0.0074, 5), crownMat);
  bananaStem.name = 'bananaStem';
  bananaStem.position.set(-0.0033, 0.0017, 0);
  bananaStem.rotation.set(0, 0, deg(62.1));
  banana.add(bananaStem);
  const bananaTip = new THREE.Mesh(new THREE.ConeGeometry(0.0048, 0.01, 5), tipMat);
  bananaTip.name = 'bananaTip';
  bananaTip.position.set(0.1845, 0.0007, 0);
  bananaTip.rotation.set(0, 0, deg(-62.7889));
  banana.add(bananaTip);

  root.traverse((o) => {
    if (o.isMesh) {
      o.castShadow = true;
      o.receiveShadow = true;
    }
  });
  return root;
}

export default createBanana;
```

---
Codels — 3D models as code for three.js. Search more: https://codels.download/api/v1/models?q=<query> · Guide: https://codels.download/llms.txt
