Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not run in my Ipad #48

Open
RyugaRyuzaki opened this issue Sep 25, 2024 · 0 comments
Open

Can not run in my Ipad #48

RyugaRyuzaki opened this issue Sep 25, 2024 · 0 comments

Comments

@RyugaRyuzaki
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant