1.1.1 • Published 2 years ago

rua-three v1.1.1

Weekly downloads
-
License
ISC
Repository
github
Last release
2 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

2 years ago

1.1.0

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago