Replies: 1 comment 4 replies
-
this is not r3f but drei, it just abstracts a declarative perspectivecamera. makeDefault is a prop of that component, it simply switches the system default camera. you can just use regular dreis cameras make switching a little easier than in plain three thats all, but its not required. for instance switching between two cams is done like this: <PerpectiveCamera makeDefault={condition === 'perspective'} />
<OrthographicCamera makeDefault={condition !== 'perspective'} /> the advantage is that it's fully declarative and state driven, other parts of the app do not have to know about it. everything else is done for you, for instance raycasting (pointerevents) will just work ootb. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm switching to r3f from regular three, just wondering what the camera makeDefault purpose is or what it is doing under the hood as I didn't need to use this in regular three.
I ask because I'm switching between cameras in viewports and find the extra step to have to set the default camera everytime pretty extra, but perhaps I'm doing something wrong?
Beta Was this translation helpful? Give feedback.
All reactions