tresjs-core-skilld
БесплатноБез исполняемых скриптовНе проверенDeclarative Three.js using Vue components. ALWAYS use when writing code that imports "@tresjs/core" or touches TresCanvas, Tres components, useLoop…
от skilld-dev★ 188 звёзд на GitHubОб этом скилле
@tresjs/core 5.9.0
Vue custom renderer for Three.js: any THREE class becomes a component by prefixing Tres (<TresMesh>, <TresBoxGeometry>). Prepared source: package.json, dist/tres.d.ts (public types), dist/tres.js.
npm dist-tags at generation time: latest 5.9.0, rc 5.0.0-rc.0, next 5.0.0-next.6, beta 2.0.0-beta.13, alpha 5.0.0-alpha.2.
Environment limits
- ESM-only since v5. No UMD, no
require().import { TresCanvas } from '@tresjs/core'. - Peer deps:
vue >=3.4,three >=0.133(package.json:44-46). Built against three^0.184. - Time source: three
Timeron r179+, falls back toClockon older three (dist/tres.d.ts:962-970). - WebGPU is experimental; requires the
rendererprop with athree/webgpuRenderer(see references/webgpu.md).
Setup
pnpm i @tresjs/core three
pnpm i @types/three -D # TypeScript
Vite: spread templateCompilerOptions into the Vue plugin, or Tres components warn as unknown custom elements (README.md:36-50):
import { templateCompilerOptions } from '@tresjs/core'
import vue from '@vitejs/plugin-vue'
import { defineConfig } from 'vite'
export default defineConfig({
plugins: [vue({ ...templateCompilerOptions })],
})
A separate subpath export @tresjs/core/template-compiler-options exists for hosts that only need compiler options (package.json:21-25). For Nuxt use @tresjs/nuxt instead of manual setup.
Core model
- Component catalogue is autogenerated from the
THREEnamespace:Tres+ capitalized class name, also available kebab-case (<tres-mesh>, supported since v5.1.0) (dist/tres.d.ts:497-509). argspasses constructor arguments:<TresBoxGeometry :args="[1, 2, 3]" />. Changing reactiveargsrecreates the whole instance; use props for everything settable after construction (dist/tres.d.ts:405-411).- Props map to instance properties. Math types accept shorthand:
:position="[1, 2, 3]",:rotation="[0, Math.PI, 0]",color="#00ff00"(dist/tres.d.ts:457-485). - Child material/geometry auto-attach via
attach:<TresMesh><TresBoxGeometry /><TresMeshNormalMaterial /></TresMesh>works without explicitattach. extend({ MyObject })before using non-THREE classes as<TresMyObject>(dist/tres.d.ts:872-874).<primitive :object="existingThreeObject" />mounts an object you created in JS. It does not own disposal; dispose manually (see references/performance.md).
Minimal scene:
<script setup lang="ts">
import { TresCanvas } from '@tresjs/core'
</script>
<template>
<TresCanvas shadows>
<TresPerspectiveCamera :position="[3, 3, 3]" :look-at="[0, 0, 0]" />
<TresMesh>
<TresBoxGeometry :args="[1, 1, 1]" />
<TresMeshNormalMaterial />
</TresMesh>
<TresDirectionalLight :position="[3, 3, 3]" :intensity="1" cast-shadow />
</TresCanvas>
</template>
Without an explicit camera, a default PerspectiveCamera is created (dist/tres.d.ts:682-685).
API changes to know
v5 breaking (migrate with references/migration-v4-v5.md):
useLoaderreturns reactive state{ state, isLoading, error, progress, load }, no longer a Promise (dist/tres.d.ts:40-65).- Pointer events use native DOM names:
@pointerdown, not@pointer-down. Only the first intersected object fires. useTexturemoved to@tresjs/cientos.useRenderLoop,useCamera,useSeek,useRaycaster,useTresReady,useTresEventManager,useLoggerwere removed. Replacements:useLoop,useTres,useGraph,@readyevent.useTresContext().camerais a camera manager; useuseTres().camerafor the active camera instance (dist/tres.d.ts:574-606).- WebGL context props (
alpha,antialias,depth,stencil,powerPreference,logarithmicDepthBuffer,preserveDrawingBuffer,failIfMajorPerformanceCaveat) are readonly; set once at mount (dist/tres.d.ts:141-206).
Recent additions:
- 5.9.0:
TresPortalcomponent reparents children into anyObject3D/Scenetarget (dist/tres.d.ts:853-858), https://docs.tresjs.org/api/components/tres-portal - 5.9.0:
isWebGPURendererguard and reactivecontext.isWebGPUflag (dist/tres.d.ts:350-367, 1204-1222) - 5.9.0:
shadowMapTypedefaults toPCFShadowMapon WebGL,PCFSoftShadowMapon WebGPU (dist/tres.d.ts:250-255) - 5.8.0:
fpsLimitprop caps render FPS (dist/tres.d.ts:692-696) - 5.7.0: three
<r179compatibility viaTimertoClockfallback (dist/tres.d.ts:962-970) - 5.5.0:
TresCanvasContext(theContextcomponent) for bringing your own<canvas>(dist/tres.d.ts:680-708) - 5.3.0:
customRendererOptions.primitivePrefixrenames<primitive>(dist/tres.d.ts:622-625) - 5.2.0:
TresCanvasProps/TresCanvasEmitstypes exported (dist/tres.d.ts:776-781) - Full history: https://github.com/Tresjs/tres/blob/main/packages/core/CHANGELOG.md
Common tasks
Animate with frame-rate independence (delta in seconds):
<script setup
Установить tresjs-core-skilld в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл tresjs-core-skilld?
Declarative Three.js using Vue components. ALWAYS use when writing code that imports "@tresjs/core" or touches TresCanvas, Tres components, useLoop, useLoader, useTres, useTresContext, TresPortal, pointer events, render modes, or TresJS debugging, upgrades, and performance work.
Как установить скилл tresjs-core-skilld?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл tresjs-core-skilld запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic