1.0.1 • Published 5 years ago

utsuroi v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

Utsuroi

The plugin makes it easy to control model animation when use Three.js :)

MIT License

npm.io

Setup

NPM Install

$ npm install utsuroi

Script Install

<script src="utsuroi.js"></script>

Basic Usage Example

// esm
import { Manipulator } from './manipulator'

let manipulator: Manipulator | undefined;
// Load asset
var loader = new THREE.GLTFLoader();
loader.load('assets/model.gltf', (gltf) {
  // Add scene
  scene.add(gltf.scene)

  // Create Manipulator
  // new Manipulator(THREE.Scene, THREE.AnimationClip[])
  manipulator = new Manipulator(gltf.scene, gltf.animations);

  // start motion
  // manipulator.play(actionName, loop)
  manipulator.play('Rest Pose', true);
});

How to update animation

Execute the update method every frame.

function tick() {
  requestAnimationFrame(tick);
  if(manipulator) {
    manipulator.update();
  }
}

tick();

How to change action

If you want to change the action, simply pass the action name, loop and duration to the to method and execute it :)

// to(ActionName[, duration, loop])
manipulator.to('Walk', 300, true);

How to pause animation

manipulator.pause();
1.0.1

5 years ago

1.0.0

5 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.15

8 years ago

0.1.14

8 years ago

0.1.13

8 years ago

0.1.12

8 years ago

0.1.11

8 years ago

0.1.10

8 years ago

0.1.9

8 years ago

0.1.8

8 years ago

0.1.7

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago