Skip to content
プロジェクト

概要

📹 A camera toolkit for the web, inspired by Unity Cinemachine.

Web・アプリ開発

この数値の測り方

計測したスター増加

24時間
0
7日間
+1
15日間
+8
1か月
履歴を収集中

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

Klipp 📹

Version Examples Docs license

A camera toolkit for the web, inspired by Unity Cinemachine. Describe the shots you want, and Klipp picks the right one and blends between them.

The core runs anywhere, with no renderer or framework attached. Integrations are thin layers on top: three.js and React Three Fiber today, with more to come, like TresJS.

npm install @pmndrs/klipp

⚠️ Early-stage, experimental - the API may change.

Core

import { Klipp, FollowBody, HardLookAtAim, VirtualCamera, targetPose } from '@pmndrs/klipp';

const klipp = new Klipp();
const player = targetPose.create(); // keep player.position up to date

const follow = new VirtualCamera('follow', { priority: 10 });
klipp.add(follow);
follow.body = new FollowBody(player, { offset: [0, 3, 8], damping: 0.5 });
follow.aim = new HardLookAtAim(player);

// every frame
klipp.update(dt);
engineCamera.setPosition(klipp.shot.position);
engineCamera.setRotation(klipp.shot.quaternion);

React Three Fiber

import { Klipp, VirtualCamera, Body, Aim } from '@pmndrs/klipp/react';

<Klipp>
  <VirtualCamera name="follow" priority={10}>
    <Body.Follow target={playerRef} offset={[0, 3, 8]} damping={0.5} />
    <Aim.HardLookAt target={playerRef} />
  </VirtualCamera>

  <VirtualCamera name="cutscene" priority={20} active={isCutscene}>
    <Body.HardLockToTarget target={[10, 2, 0]} />
    <Aim.HardLookAt target={playerRef} />
  </VirtualCamera>
</Klipp>;

What's inside

  • Virtual cameras with priorities, and blending between them.
  • KlippControls: orbit, pan and zoom with the mouse or touch, in perspective and orthographic views.
  • Groups: play shots in a sequence, or mix several cameras by weight.
  • Body and Aim: follow, frame or look at targets, or let the user orbit and look around.
  • Extension: lens, group framing, camera offset, follow zoom, confiner and recomposer.
  • Noise and Impulse: camera shake.
  • Perspective and orthographic cameras.
  • Debugging: framing zones and camera frustums.

Packages

Entry point For
@pmndrs/klipp The core, built on math.
@pmndrs/klipp/three three.js classes, ending in Three.
@pmndrs/klipp/react React Three Fiber components.
@pmndrs/klipp/dom Mouse, touch and wheel input and debug overlays.

Links

関連プロジェクトを探す

読み込み中…