1.1.1 • Published 3 years ago

rua-three v1.1.1

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

RUA Three

A three.js hooks for React.

Usage

const init: InitFn = ({ scene, camera, addRenderCallback }) => {
  scene.add(new THREE.AmbientLight('#fff', 0.6));
  camera.position.set(0, 5, 5);

  const material = new THREE.MeshStandardMaterial({ color: '#ff0000' });
  const cubeGeo = new THREE.BoxGeometry(2, 2, 2);
  const cube = new THREE.Mesh(cubeGeo, material);
  scene.add(cube);

  const update = (time: number) => {
    cube.rotation.y = time;
  };
  addRenderCallback(update);
};

export default function Web() {
  const { ref } = useThree({ init });

  return <canvas ref={ref}></canvas>;
}
1.1.1

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago