From bd6f16c7a6695606d7ebb5baa56eefe65b603cf2 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期二, 11 六月 2024 16:48:01 +0800 Subject: [PATCH] # --- src/components/ctrl.jsx | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/ctrl.jsx b/src/components/ctrl.jsx index dca23c7..d5050e8 100644 --- a/src/components/ctrl.jsx +++ b/src/components/ctrl.jsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect } from 'react'; +import React, { useRef, useState, useEffect } from 'react'; import { PerspectiveCamera, CameraControls, @@ -8,8 +8,10 @@ FirstPersonControls, MapControls, } from '@react-three/drei'; +import { useThree, useFrame } from '@react-three/fiber'; const Controls = (props) => { + const controlsRef = useRef(); const [choiceCtrls, setChoiceCtrls] = useState(false); useEffect(() => { @@ -24,7 +26,13 @@ return ( <group> {/* <PresentationControls /> */} - <CameraControls /> + {/* <CameraControls ref={controlsRef} /> */} + <OrbitControls + ref={controlsRef} + // autoRotate + // autoRotateSpeed={0.5} + target={[-200, 100, 0]} + /> {/* <PointerCtrl /> */} </group> ); -- Gitblit v1.9.1