Back to list
cerico

threejs

by cerico

https://macfair.io37.ch

0🍴 0📅 Jan 25, 2026

SKILL.md


name: threejs description: Build 3D scenes, animations, and interactive experiences with Three.js. Use for product viewers, backgrounds, data visualization, or creative experiments.

Three.js

Build 3D scenes and interactive experiences for the web.

Status: Starter

Patterns will evolve with use.

When to Use

  • Product viewers / 3D showcases
  • Interactive backgrounds
  • Data visualization in 3D
  • Creative experiments
  • Game-like experiences

Setup

Vanilla

pnpm add three
pnpm add -D @types/three

React (React Three Fiber)

pnpm add three @react-three/fiber @react-three/drei
pnpm add -D @types/three

Basic Patterns

Vanilla Three.js

import * as THREE from 'three'

const scene = new THREE.Scene()
const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000)
const renderer = new THREE.WebGLRenderer({ antialias: true })

renderer.setSize(window.innerWidth, window.innerHeight)
document.body.appendChild(renderer.domElement)

// Add a cube
const geometry = new THREE.BoxGeometry()
const material = new THREE.MeshStandardMaterial({ color: 0x00ff00 })
const cube = new THREE.Mesh(geometry, material)
scene.add(cube)

// Add light
const light = new THREE.DirectionalLight(0xffffff, 1)
light.position.set(5, 5, 5)
scene.add(light)

camera.position.z = 5

// Animation loop
function animate() {
  requestAnimationFrame(animate)
  cube.rotation.x += 0.01
  cube.rotation.y += 0.01
  renderer.render(scene, camera)
}
animate()

React Three Fiber

import { Canvas } from '@react-three/fiber'
import { OrbitControls, Environment } from '@react-three/drei'

function Box() {
  return (
    <mesh>
      <boxGeometry args={[1, 1, 1]} />
      <meshStandardMaterial color="orange" />
    </mesh>
  )
}

export default function Scene() {
  return (
    <Canvas camera={{ position: [3, 3, 3] }}>
      <ambientLight intensity={0.5} />
      <directionalLight position={[10, 10, 5]} />
      <Box />
      <OrbitControls />
      <Environment preset="studio" />
    </Canvas>
  )
}

Common Recipes

Load GLTF Model

import { useGLTF } from '@react-three/drei'

function Model() {
  const { scene } = useGLTF('/model.glb')
  return <primitive object={scene} />
}

Responsive Canvas

<Canvas
  style={{ width: '100%', height: '100vh' }}
  camera={{ position: [0, 0, 5], fov: 50 }}
  dpr={[1, 2]}
>

Post-Processing

pnpm add @react-three/postprocessing
import { EffectComposer, Bloom } from '@react-three/postprocessing'

<EffectComposer>
  <Bloom luminanceThreshold={0.9} intensity={0.5} />
</EffectComposer>

Animation with useFrame

import { useFrame } from '@react-three/fiber'
import { useRef } from 'react'

function SpinningBox() {
  const ref = useRef()
  useFrame((state, delta) => {
    ref.current.rotation.y += delta
  })
  return (
    <mesh ref={ref}>
      <boxGeometry />
      <meshStandardMaterial color="hotpink" />
    </mesh>
  )
}

AI Asset Pipeline (Nano Banana)

  1. Generate image in Google AI Studio with Nano Banana
  2. Convert to 3D via Tripo, Meshy, or similar
  3. Export as GLTF/GLB
  4. Load in Three.js

Reference

TODO

  • First real project to establish patterns
  • Decide vanilla vs React Three Fiber preference
  • Add shader patterns
  • Add physics (rapier) patterns

Score

Total Score

55/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

1ヶ月以内に更新

+10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

+5

Reviews

💬

Reviews coming soon