Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scale on resize after animating camera position Y #3368

Open
KrystofCernik opened this issue Sep 27, 2024 · 0 comments
Open

Scale on resize after animating camera position Y #3368

KrystofCernik opened this issue Sep 27, 2024 · 0 comments

Comments

@KrystofCernik
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants