Open RyugaRyuzaki opened 1 month ago
I tried to implement (use expo) here my code:
import * as THREE from "three"; import {StatusBar} from "expo-status-bar"; import {Text, View} from "react-native"; import {Suspense} from "react"; import {Canvas} from "@react-three/fiber/native"; import {useGLTF} from "@react-three/drei/native"; import useControls from "r3f-native-orbitcontrols"; function Model(props: any) { const gltf = useGLTF(require("./assets/pmndrs.glb")); //@ts-ignore return <primitive {...props} object={gltf.scene} />; } export default function App() { const [OrbitControls, events] = useControls(); return ( <View className="relative h-full w-full"> <Suspense fallback={null}> <Canvas className="absolute w-full"> <OrbitControls enablePan={false} /> <directionalLight position={[1, 0, 0]} args={["white", 2]} /> <directionalLight position={[-1, 0, 0]} args={["white", 2]} /> <directionalLight position={[0, 0, 1]} args={["white", 2]} /> <directionalLight position={[0, 0, -1]} args={["white", 2]} /> <directionalLight position={[0, 1, 0]} args={["white", 15]} /> <directionalLight position={[0, -1, 0]} args={["white", 2]} /> <mesh> <boxGeometry></boxGeometry> <meshStandardMaterial color={"orange"}></meshStandardMaterial> </mesh> </Canvas> </Suspense> </View> ); }
However when i open my ipad, can not rotate or pan in touch. Any idea for this? Many thank
I tried to implement (use expo) here my code:
However when i open my ipad, can not rotate or pan in touch. Any idea for this? Many thank