Communitygithub.com

cloudai-x/threejs-animation

Three.jsアニメーション - キーフレームアニメーション、スケルトンアニメーション、モーフターゲット、アニメーションミキシング。オブジェクトのアニメーション、GLTFアニメーションの再生、プロシージャルモーションの作成、アニメーションのブレンド時に使用します。

threejs-animation とは?

このスキルは、Three.jsを使用した3Dアニメーションの作成と管理を支援します。キーフレームアニメーション、スケルトンアニメーション、モーフターゲット、アニメーションミキシングなど、Three.jsが提供する主要なアニメーション機能を活用できます。オブジェクトのアニメーション化、GLTFファイルからのアニメーション再生、プロシージャルなモーション生成、複数アニメーションのブレンドといったタスクに特に有用です。Claude CodeやCursorなどのAIエージェントプラットフォームと連携し、開発者がThree.jsアニメーションを効率的に実装するための知識とガイダンスを提供します。このスキルは、適切なアニメーション手法の選択、アニメーションミキサーの設定、クリップの管理、そしてパフォーマンス最適化のベストプラクティスをカバーしています。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/cloudai-x/threejs-skills/tree/main/skills/threejs-animation

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

threejs-animation は何をしますか?

Three.jsアニメーション - キーフレームアニメーション、スケルトンアニメーション、モーフターゲット、アニメーションミキシング。オブジェクトのアニメーション化、GLTFアニメーションの再生、プロシージャルモーションの作成、アニメーションのブレンド時に使用します。

概要

このスキルは、Three.jsを使用した3Dアニメーションの実装を支援します。キーフレームアニメーション、スケルトンアニメーション、モーフターゲット、アニメーションミキシングなど、Three.jsの主要なアニメーション機能をカバーしています。

主な機能

  • キーフレームアニメーション: 時間経過に伴うプロパティの変化を定義
  • スケルトンアニメーション: ボーンとスキンメッシュを使用したキャラクターアニメーション
  • モーフターゲット: 形状のブレンドによる滑らかな変形
  • アニメーションミキシング: 複数のアニメーションクリップを合成・ブレンド

使用方法

キーフレームアニメーションの作成

// キーフレームトラックの作成
const positionTrack = new THREE.VectorKeyframeTrack(
  '.position',
  [0, 1, 2],
  [0, 0, 0, 10, 0, 0, 0, 0, 0]
);

// アニメーションクリップの作成
const clip = new THREE.AnimationClip('move', 2, [positionTrack]);

GLTFアニメーションの再生

// GLTFローダーでアニメーションを読み込み
const loader = new THREE.GLTFLoader();
loader.load('model.gltf', (gltf) => {
  const mixer = new THREE.AnimationMixer(gltf.scene);
  const action = mixer.clipAction(gltf.animations[0]);
  action.play();
  
  // アニメーションループで更新
  function animate() {
    requestAnimationFrame(animate);
    mixer.update(deltaTime);
    renderer.render(scene, camera);
  }
});

アニメーションのブレンド

// 複数のアニメーションアクションを作成
const walkAction = mixer.clipAction(walkClip);
const runAction = mixer.clipAction(runClip);

// クロスフェード
walkAction.crossFadeTo(runAction, 0.5);
walkAction.stop();
runAction.play();

注意事項

  • アニメーションミキサーはフレームループ内で毎回更新する必要があります
  • パフォーマンスに注意し、不要なアニメーションは停止してください
  • モーフターゲットは大量の頂点データを消費するため、最適化が必要な場合があります

関連リソース

Individual skills in this repo

This repo contains 9 individual skills — each has its own dedicated page.

cloudai-x/threejs-fundamentals

Three.js scene setup, cameras, renderer, Object3D hierarchy, coordinate systems. Use when setting up 3D scenes, creating cameras, configuring renderers, managing object hierarchies, or working with transforms.

cloudai-x/threejs-geometry

Three.js geometry creation - built-in shapes, BufferGeometry, custom geometry, instancing. Use when creating 3D shapes, working with vertices, building custom meshes, or optimizing with instanced rendering.

cloudai-x/threejs-interaction

Three.js interaction - raycasting, controls, mouse/touch input, object selection. Use when handling user input, implementing click detection, adding camera controls, or creating interactive 3D experiences.

cloudai-x/threejs-lighting

Three.js lighting - light types, shadows, environment lighting. Use when adding lights, configuring shadows, setting up IBL, or optimizing lighting performance.

cloudai-x/threejs-loaders

Three.js asset loading - GLTF, textures, images, models, async patterns. Use when loading 3D models, textures, HDR environments, or managing loading progress.

cloudai-x/threejs-materials

Three.js materials - PBR, basic, phong, shader materials, material properties. Use when styling meshes, working with textures, creating custom shaders, or optimizing material performance.

cloudai-x/threejs-postprocessing

Three.js post-processing - EffectComposer, bloom, DOF, screen effects. Use when adding visual effects, color grading, blur, glow, or creating custom screen-space shaders.

cloudai-x/threejs-shaders

Three.js shaders - GLSL, ShaderMaterial, uniforms, custom effects. Use when creating custom visual effects, modifying vertices, writing fragment shaders, or extending built-in materials.

cloudai-x/threejs-textures

Three.js textures - texture types, UV mapping, environment maps, texture settings. Use when working with images, UV coordinates, cubemaps, HDR environments, or texture optimization.

関連スキル