Camera and scene getting printed two times in react-three. What is the reason

17 Views Asked by At
import { Canvas,useThree,useFrame } from '@react-three/fiber';
const LogCamera = () =>{
  const { scene, camera} = useThree();
  console.log(camera);
  console.log(scene);
  return null;
}
function App() {
  return (
    <Canvas >
      <LogCamera/>
    </Canvas>
  );
}

export default App;

actually I was trying to write a code to animate the camera so to do so i was fetching camera from useThree() i was getting two cameras. one perspective and one orthographic while my makedefault camera was only one orthograpic. for scene also it was giving two output. what is the reason behind it and any idea how to fix this?

couldn't figure out anything

0

There are 0 best solutions below