How is the lookAt method used inside the default camera? #1450
Unanswered
ismasgrove
asked this question in
Q&A
Replies: 0 comments
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.
-
I haven't been using React for long so this is a tricky piece of syntax for me. But when using the default camera in I'm unsure of how to access the lookAt method. Of course, it's doable using a useThree hook, but I was wondering if there was another way to do it. For example, when using a PerspectiveCamera instead of the default, I'd use:
<perspectiveCamera lookAt={[1, 0, 0]}>
Which feels like it should intuitively be analogous to:
<Canvas camera={{ position: [0, 0, 3], fov: 45, lookAt: [1,0,0]> }}
But here, React doesn't like that lookAt is a method and not a property. Of course, It's not a pressing, life shattering matter by any means and I already listed two ways of getting around it, but I wonder what's the proper way to do it.
Beta Was this translation helpful? Give feedback.
All reactions