Replies: 1 comment
-
You are using stage with the adjust camera prop, it will zoom to fit. Stage is very opinionated and if you want full control over the camera I wouldn’t use it, or at least omit the adjustCamera prop |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello author, when I analyze gltf resources for display, the camera always seems to adapt to a certain point. I don’t know if this point is consistent for different resources. I tried to set the camera on Canvas and found that only the fov attribute takes effect, position The change has no actual effect; in fact, I want to customize a fixed position of the camera or get the default position of self-adaptation. The requirement is to have a clear value for the designer who exports the gltf resource. They follow this standard To design the final as much as possible to keep all resources displayed consistently
The version number of the library I am using:
"@react-three/drei": "^9.32.1",
"@react-three/fiber": "^8.6.0",
"react-three-fiber": "^6.0.13",
"three": "^0.145.0",
"react": "^18.2.0",
Below is my specific code:
`import React, { Suspense, useRef, } from 'react'
import { Canvas } from '@react-three/fiber'
import { Stage, OrbitControls } from '@react-three/drei';
export default function Viewer({ environment, preset, scene} : any) {
const ref:any = useRef();
return (
<Canvas style={{ width: '100%', height: '100%' }} dpr={[1, 1.5]} camera={{ fov: 75, position: [0, 0, 150] }}>
<Stage
// @ts-ignore
controls={ref}
preset={preset}
// intensity={0.5}
adjustCamera
environment={environment}
>
<OrbitControls
// @ts-ignore
ref={ref}
autoRotate
/>
)
}
`
Beta Was this translation helpful? Give feedback.
All reactions