Scale on resize after animating camera position Y #3428
Unanswered
KrystofCernik
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.
-
Heey! I just spend too much time trying to figure this out, but cannot really find a solution.. I animate camera position y, sync it with scroll actually so in my useFrame, I run camera.position.y = -window.scrollY * ratio (which just turns the scrollY to threejs units) ... The problem is that if I resize, all things in the scene get kinda zoom, scaled more of, and more I resize, camera position y is increasing, even though window.scrollY is constant. If camera.position.y = 0, which means I'm at top of my page, this is not happening, only if camera position y is bigger than zero .. Would you have any idea why is this happening? Hopefully I'm being clear :) Seems like calling updateProjectionMatrix or gl.setSize would fix this, but no
Beta Was this translation helpful? Give feedback.
All reactions