扩展OrbitControls
- 因为OrbitControls 是在 jsm文件下的扩展文件,所有可以使用
extend
的方式将其扩展成 react的虚拟dom
import { useFrame, extend } from "@react-three/fiber"
import { useRef } from "react"
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js'
//extend({ OrbitControls })
//or
extend({ OrbitControls: OrbitControls})
import { useFrame, extend } from "@react-three/fiber"
import { useRef } from "react"
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js'
//extend({ OrbitControls })
//or
extend({ OrbitControls: OrbitControls})
export