AI Skill Report Card

Generating 3D Cartoon Models

A-84·Dec 1, 2026·Source: Web

Generating 3D Cartoon Models (Three.js + GLB)

14 / 15

Output a single HTML file. Import Three.js and addons via import map. Skeleton:

HTML
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Cartoon Model</title> <style> html, body { margin: 0; height: 100%; overflow: hidden; background: #cfe8ff; font-family: system-ui, sans-serif; } canvas { display: block; touch-action: none; } #bar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; gap: 8px; padding: 8px; background: rgba(255,255,255,.85); border-radius: 999px; backdrop-filter: blur(8px); box-shadow: 0 4px 16px rgba(0,0,0,.2); } #bar button { border: 0; border-radius: 999px; padding: 10px 16px; font-size: 14px; font-weight: 600; background: #ff7a59; color: #fff; cursor: pointer; min-height: 44px; } #bar button:active { transform: scale(.96); } </style> <script type="importmap"> { "imports": { "three": "https://cdn.jsdelivr.net/npm/three@0.160.0/build/three.module.js", "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.160.0/examples/jsm/" } } </script> </head> <body> <div id="bar"> <button id="btnPlay">⏸ Pause</button> <button id="btnWire">Wireframe</button> <button id="btnGlb">⬇ .GLB</button> </div> <script type="module"> import * as THREE from 'three'; import { OrbitControls } from 'three/addons/controls/OrbitControls.js'; import { GLTFExporter } from 'three/addons/exporters/GLTFExporter.js'; // 1. scene/camera/renderer 2. lights + pedestal 3. buildCharacter() 4. controls 5. animate loop 6. buttons </script> </body> </html>
Recommendation▾
Make the examples true input/output pairs. The three outputs are prose descriptions of what the HTML should contain, not code or a concrete artifact. Add at least one complete, minimal buildCharacter() implementation (e.g. a bear head with eyes, ears, and a wave pivot) so Claude sees real geometry/material/pivot code, not a parts list.
14 / 15
Progress:
- [ ] Step 1: Plan the design (silhouette, palette, proportions, parts list)
- [ ] Step 2: Set up renderer, camera, scene, backdrop, pedestal
- [ ] Step 3: Add three-point lighting with shadows
- [ ] Step 4: Build the model as a named THREE.Group hierarchy
- [ ] Step 5: Add OrbitControls
- [ ] Step 6: Add idle animation + animate loop
- [ ] Step 7: Wire the three control buttons (play/pause, wireframe, GLB)
- [ ] Step 8: Self-check against the checklist in Best Practices

Step 1: Plan the design

Before coding, decide in comments: 4–6 palette colors, head-to-body ratio (head ≈ 50–60% of total height for characters), and the part list (e.g. head, eyes, ears, torso, arms, legs, tail). Keep total height ≈ 2–3 units, centered on the pedestal.

Step 2: Renderer, scene, pedestal

JavaScript
const renderer = new THREE.WebGLRenderer({ antialias: true, alpha: false }); renderer.setPixelRatio(Math.min(devicePixelRatio, 2)); renderer.setSize(innerWidth, innerHeight); renderer.shadowMap.enabled = true; renderer.shadowMap.type = THREE.PCFSoftShadowMap; renderer.outputColorSpace = THREE.SRGBColorSpace; renderer.toneMapping = THREE.ACESFilmicToneMapping; document.body.appendChild(renderer.domElement); const scene = new THREE.Scene(); scene.background = new THREE.Color(0xcfe8ff); scene.fog = new THREE.Fog(0xcfe8ff, 12, 30); const camera = new THREE.PerspectiveCamera(40, innerWidth / innerHeight, 0.1, 100); camera.position.set(4, 2.6, 6); // Pedestal: rounded cylinder + shadow-catching floor const pedestal = new THREE.Mesh( new THREE.CylinderGeometry(2.2, 2.4, 0.3, 64), new THREE.MeshStandardMaterial({ color: 0xffffff, roughness: 0.6 }) ); pedestal.position.y = -0.15; pedestal.receiveShadow = true; scene.add(pedestal);

Pedestal is NOT part of the exported model. Keep it outside the main group.

Step 3: Three-point lighting

JavaScript
const key = new THREE.DirectionalLight(0xfff1d6, 2.4); // warm key key.position.set(5, 8, 5); key.castShadow = true; key.shadow.mapSize.set(2048, 2048); key.shadow.camera.left = key.shadow.camera.bottom = -5; key.shadow.camera.right = key.shadow.camera.top = 5; key.shadow.bias = -0.0005; key.shadow.radius = 4; const fill = new THREE.DirectionalLight(0xa8c8ff, 0.9); // cool fill, no shadow fill.position.set(-6, 3, 3); const rim = new THREE.DirectionalLight(0xffffff, 1.8); // bright rim rim.position.set(-2, 5, -7); scene.add(key, fill, rim, new THREE.HemisphereLight(0xffffff, 0xbcd4ff, 0.5));

Step 4: Build the model

Create one root group and add everything to it:

JavaScript
const model = new THREE.Group(); model.name = 'CartoonModel'; scene.add(model);

Materials: Use a shared 3-step gradient map for toon shading.

JavaScript
function makeGradient(steps = 3) { const data = new Uint8Array(steps); for (let i = 0; i < steps; i++) data[i] = Math.round(255 * (i + 1) / steps); const tex = new THREE.DataTexture(data, steps, 1, THREE.RedFormat); tex.minFilter = tex.magFilter = THREE.NearestFilter; tex.generateMipmaps = false; tex.needsUpdate = true; return tex; } const gradient = makeGradient(3); const toon = (color) => new THREE.MeshToonMaterial({ color, gradientMap: gradient });

Part helper (reduces boilerplate, enforces shadows and names):

JavaScript
function part(name, geo, mat, pos = [0,0,0], scale = [1,1,1], parent = model) { const m = new THREE.Mesh(geo, mat); m.name = name; m.position.set(...pos); m.scale.set(...scale); m.castShadow = m.receiveShadow = true; parent.add(m); return m; }

Geometry recipes (use these instead of boxes):

NeedTechnique
Head/body blobSphereGeometry(r, 48, 32) with non-uniform scale (e.g. [1, 0.92, 1])
LimbsCapsuleGeometry(r, len, 8, 24)
Ears/horns/conesConeGeometry with 32+ segments, or LatheGeometry from a curve
Bottle/vase/hat/cupLatheGeometry from Vector2 profile points
Tail/tentacle/antennaTubeGeometry along CatmullRomCurve3
Badges/flat detailsExtrudeGeometry from a Shape with bevelEnabled: true
Squash/lumpy shapeDisplace sphere vertices with low-frequency sin noise, then computeVertexNormals()

Eyes (essential for personality): white sclera sphere, black pupil sphere pushed forward, tiny white highlight sphere offset up-right on each pupil. Eyes should be large (≈ 15–20% of head width each) with MeshStandardMaterial({roughness: 0.15}) for glossiness.

Outline (optional, cheap): for each key mesh, add a child clone with BackSide, scaled 1.04, MeshBasicMaterial({color: 0x1a1a2e, side: THREE.BackSide}), castShadow = false. Name it outline_*.

Rig-friendly pivots: put limbs inside their own THREE.Group positioned at the joint (shoulder/hip), with the mesh offset inside the group. Animate the group, not the mesh.

Step 5: Controls

JavaScript
const controls = new OrbitControls(camera, renderer.domElement); controls.enableDamping = true; controls.dampingFactor = 0.08; controls.target.set(0, 1.2, 0); controls.minDistance = 2.5; controls.maxDistance = 14; controls.maxPolarAngle = Math.PI * 0.495; // don't go under the floor controls.touches = { ONE: THREE.TOUCH.ROTATE, TWO: THREE.TOUCH.DOLLY_PAN };

Step 6: Animation loop

JavaScript
let playing = true; const clock = new THREE.Clock(); let t = 0; function animate() { requestAnimationFrame(animate); const dt = clock.getDelta(); if (playing) { t += dt; model.position.y = Math.abs(Math.sin(t * 2)) * 0.12; // bounce model.rotation.y = Math.sin(t * 0.8) * 0.25; // sway // wave: rightArmPivot.rotation.z = -1.2 + Math.sin(t * 6) * 0.4; // squash/stretch: model.scale.set(1 + s, 1 - s, 1 + s) where s = Math.sin(t * 4) * 0.02; } controls.update(); renderer.render(scene, camera); } animate(); addEventListener('resize', () => { camera.aspect = innerWidth / innerHeight; camera.updateProjectionMatrix(); renderer.setSize(innerWidth, innerHeight); });

Step 7: Control buttons

JavaScript
const $ = (id) => document.getElementById(id); $('btnPlay').onclick = (e) => { playing = !playing; e.target.textContent = playing ? '⏸ Pause' : '▶ Play'; }; let wire = false; $('btnWire').onclick = () => { wire = !wire; model.traverse((o) => { if (o.isMesh && !o.name.startsWith('outline_')) { (Array.isArray(o.material) ? o.material : [o.material]).forEach(m => m.wireframe = wire); } if (o.name.startsWith('outline_')) o.visible = !wire; }); }; $('btnGlb').onclick = () => { // Reset transient animation transforms so the export is in bind pose const saved = { p: model.position.clone(), r: model.rotation.clone(), s: model.scale.clone() }; model.position.set(0, 0, 0); model.rotation.set(0, 0, 0); model.scale.set(1, 1, 1); new GLTFExporter().parse( model, (glb) => { const url = URL.createObjectURL(new Blob([glb], { type: 'model/gltf-binary' })); const a = Object.assign(document.createElement('a'), { href: url, download: 'cartoon-model.glb' }); document.body.appendChild(a); a.click(); a.remove(); setTimeout(() => URL.revokeObjectURL(url), 1000); model.position.copy(saved.p); model.rotation.copy(saved.r); model.scale.copy(saved.s); }, (err) => { console.error(err); alert('GLB export failed: ' + err.message); }, { binary: true, onlyVisible: true } ); };
Recommendation▾
Add a bad-vs-good contrast. Show a short snippet of the blocky BoxGeometry/no-gradient-map result next to the corrected capsule/toon version. Pitfalls are currently one-line bullets, so they don't demonstrate the failure mode concretely.
14 / 20

Example 1: Input: "Make me a 3D cartoon bear mascot." Output: A single HTML file where model contains: a squashed-sphere head (scale [1.1, 0.95, 1]), two small sphere ears with inner-ear pink spheres, a pear-shaped body (lathe or scaled sphere), capsule arms in shoulder pivot groups (right arm animated to wave), stubby capsule legs, a lighter muzzle ellipsoid with a dark nose sphere, and glossy eyes with highlights. Palette: #b5703c fur, #e8c39e muzzle/belly, #2b1d16 nose/pupils. Idle: bounce + right-arm wave. Pedestal and lights sit outside model.

Example 2: Input: "Cartoon potion bottle prop." Output: Bottle body from LatheGeometry with profile points [(0,0), (0.9,0.05), (1,0.4), (0.95,1.0), (0.5,1.5), (0.32,1.7), (0.34,2.0), (0,2.0)]; translucent glass via MeshStandardMaterial({color:0x9fffe0, transparent:true, opacity:0.55, roughness:0.1}); inner liquid as a slightly smaller lathe in saturated green; a cork as a short capsule/cylinder; floating bubble spheres animated with sin(t + i). Idle: slow turntable + bubbles rising.

Example 3: Input: "A cute cartoon cloud with a face, as a scene." Output: Cloud from 5–7 overlapping white spheres of varied radii with scale.y = 0.85; a happy face (eyes with highlights, small TorusGeometry arc smile, pink cheek discs); small ExtrudeGeometry raindrops falling and looping below. Pedestal replaced by a soft blue floor disc. Idle: gentle float + drops falling.

Recommendation▾
Tighten for conciseness. Cut sections Claude already knows (the resize handler, the generic OrbitControls and renderer boilerplate, the full lighting block) down to the non-obvious settings, or move the long code blocks into a separate reference file. Quick Start also ends in a placeholder comment instead of a runnable minimal scene, so it delivers less immediate value than it could.
  • Single self-contained file. No external assets, textures, or fonts. Generate everything procedurally.
  • Name every mesh and group (head, eye_L, arm_R_pivot). Names survive GLB export and help users in Blender.
  • Palette discipline: 4–6 colors, one dominant, one accent, one dark for details. Avoid pure black (#1a1a2e instead).
  • Share materials across parts of the same color to keep the GLB small and consistent.
  • Segment counts: 32–64 radial segments for smooth silhouettes; stay under ~150k triangles total.
  • Face the model toward +Z so the default camera sees the front.
  • Pre-delivery checklist: model sits on the pedestal (feet at y≈0), shadows visible, eyes have highlights, buttons ≥ 44px tall, no console errors, wireframe toggle works, GLB downloads and contains only model (no lights, pedestal, or camera).
  • Add a one-line comment at the top of the script describing the character and how to tweak the palette.
  • Using plain BoxGeometry for body parts. Results look blocky, not cartoon. Use capsules, scaled spheres, and lathes.
  • Adding the pedestal, lights, or helpers into model. They'll pollute the exported GLB.
  • Exporting mid-animation. Always reset transforms (or clone in bind pose) before GLTFExporter.parse.
  • Forgetting castShadow/receiveShadow. Model looks flat and floats; use the part() helper.
  • Toon material without a gradient map. Looks like unlit plastic; always supply gradientMap with NearestFilter.
  • Outline meshes left visible during export or wireframe. Hide or exclude them.
  • Tiny, dull eyes. Eyes drive appeal; make them large, glossy, with a highlight.
  • Mismatched Three.js versions between three and three/addons/ in the import map; pin both to the same version.
  • Using OrbitControls without controls.update() in the loop when damping is on.
  • Over-long output. If the model needs > ~500 lines, extract builders into functions (buildHead(), buildArms()) rather than inlining everything.
0
Grade A-AI Skill Framework
Scorecard
Criteria Breakdown
Quick Start
14/15
Workflow
14/15
Examples
14/20
Completeness
16/20
Format
15/15
Conciseness
11/15