-
I have created a simple program using react-three/xr with Next.js. // app/page.js
"use client";
import { Sphere } from "@react-three/drei";
import { Canvas } from "@react-three/fiber";
import { XR, createXRStore } from "@react-three/xr";
export default function Home() {
const store = createXRStore();
return (
<main className="container mx-auto">
<h1 className="mt-4 mb-4 text-4xl">React Three XR</h1>
<button onClick={() => store.enterVR()}>Enter VR</button>
<Canvas shadows className="aspect-video border border-gray-300">
<XR store={store}>
<ambientLight intensity={0.2} />
<directionalLight position={[5, 5, 5]} intensity={1} />
<Sphere args={[1, 32, 32]}>
<meshStandardMaterial
color="#fafafa"
roughness={0.4}
metalness={0.4}
/>
</Sphere>
</XR>
</Canvas>
</main>
);
} After executing the Click on the However, when I access the local host directly with a metaquest3 browser, it does not work properly. Click on the What is the cause of not working with metaquest3? |
Beta Was this translation helpful? Give feedback.
Answered by
link2004
Sep 19, 2024
Replies: 1 comment
-
Self resolved. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
link2004
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Self resolved.
yarn dev --experimental-https
and started the server with https and it worked fine.