Community画像github.com

cloudai-x/threejs-loaders

Three.jsアセット読み込み - GLTF、テクスチャ、画像、モデル、非同期パターン。3Dモデル、テクスチャ、HDR環境の読み込みや、読み込み進捗の管理に使用します。

threejs-loaders とは?

このスキルは、Three.jsを使用した3Dアセットの効率的な読み込みを支援します。GLTFモデル、テクスチャ画像、HDR環境マップなど、様々なアセットタイプに対応し、非同期パターンを使用することでスムーズな読み込みを実現します。また、読み込み進捗の管理機能により、ユーザーにローディング状態を表示することが可能です。Three.jsを使用するあらゆるプラットフォーム(ウェブ、React Three Fiberなど)で利用でき、3Dアプリケーション開発におけるアセット管理を簡素化します。このスキルは、Three.jsの標準的なLoaderクラス(GLTFLoader、TextureLoader、FileLoaderなど)の使用方法や、非同期処理のベストプラクティスに基づいて動作します。

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

Installed? Explore more 画像 skills: steipete/songsee, affaan-m/frontend-design, mattpocock/improve-codebase-architecture · View all 6 →

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

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

ドキュメント

threejs-loaders は何をしますか?

Three.jsアセット読み込み - GLTF、テクスチャ、画像、モデル、非同期パターン。3Dモデル、テクスチャ、HDR環境の読み込みや、読み込み進捗の管理に使用します。

使用方法

以下のサンプルコードを参照して、アセットを読み込んでください。

import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
import { TextureLoader } from 'three';
import { HDRLoader } from '...';

const loader = new GLTFLoader();
loader.load(
  'path/to/model.gltf',
  (gltf) => {
    scene.add(gltf.scene);
  },
  (xhr) => {
    console.log((xhr.loaded / xhr.total) * 100 + '% loaded');
  },
  (error) => {
    console.error('An error happened', error);
  }
);

const textureLoader = new TextureLoader();
textureLoader.load(
  'path/to/texture.jpg',
  (texture) => {
    material.map = texture;
    material.needsUpdate = true;
  }
);

サポートされるアセットタイプ

  • GLTFモデル(.gltf, .glb)
  • テクスチャ画像(.jpg, .png, .webp)
  • HDR環境マップ(.hdr, .exr)

非同期パターン

async/await を使用して、アセット読み込みを簡略化できます。

async function loadModel(url) {
  const loader = new GLTFLoader();
  return new Promise((resolve, reject) => {
    loader.load(url, resolve, undefined, reject);
  });
}

const gltf = await loadModel('path/to/model.gltf');

Individual skills in this repo

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

cloudai-x/threejs-animation

Three.js animation - keyframe animation, skeletal animation, morph targets, animation mixing. Use when animating objects, playing GLTF animations, creating procedural motion, or blending animations.

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-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.

関連スキル