From c06d11bbb8c87baaa8d7e70e82217873249a43e7 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期三, 31 七月 2024 17:30:02 +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..eb25dc5 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