0.0.2 • Published 1 year ago

use-vrm v0.0.2

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
1 year ago

useVRM

The useVRM hook for displaying VRM models. Powered by react-three-fiber and pixiv/three-vrm

!NOTE Semantic Versioning may not be followed for 0.x releases until reaching a stable state.

Usage

import { Suspense } from "react";
import { useVRM } from "use-vrm";

function Model() {
  const { vrm } = useVRM("./example.vrm", "./idle.vrma");

  // loading is handled via suspend-react
  return <primitive object={vrm.scene} />;
}

function App() {
  return (
    <Suspense fallback={<FallbackComponent /> /* or null */}>
      <Model />
    </Suspense>
  );
}

Example

Open in StackBlitz

0.0.2

1 year ago

0.0.1

1 year ago