How to connect Threejs to React?

后端 未结 5 1062
[愿得一人]
[愿得一人] 2020-12-07 16:39

I work with React and use a canvas. I want to change the canvas to WebGL (Threejs library). How to connect this library to React?

I have some element, e.g.

5条回答
  •  误落风尘
    2020-12-07 17:44

    If you are working with hooks. here is an example of a loaded 3D model from three.js with React.js.

    https://github.com/sarat9/react-threejs-sample/blob/master/src/animations/SoldierMachineAnimation/index.jsx

提交回复
热议问题