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

"Jumping" when close to first image #1

Open
Romsha opened this issue May 12, 2022 · 1 comment
Open

"Jumping" when close to first image #1

Romsha opened this issue May 12, 2022 · 1 comment
Assignees

Comments

@Romsha
Copy link
Owner

Romsha commented May 12, 2022

When the user comes near a picture for the first time (since the page was loaded), a small "lag" occurs when the description opens and the camera is sent backwards somehow.
Two ideas for the reason of this:

  1. There is something wrong with the initial values of the variables regarding picture "closeness" handling, which gets in the way of the moving animation.
  2. (more likely) Opening the iframe for the first time is resources - consuming and cuts the movement
@Romsha Romsha self-assigned this May 12, 2022
@Romsha
Copy link
Owner Author

Romsha commented May 13, 2022

After more debugging I believe this is in fact caused by turning on the lights for the first time. Notice that starting with one light on does not help.
The effect is a big decrease in FPS (60 -> 5) when the light is turned on, which causes a major jump in the animation (may move the camera, go through walls and such). The variable representing the FPS in the code is "deltaTime", so my quick fix was to set its upper boundary to 25 FPS (1/25 seconds). This prevents "jumps", but still doesn't fix the small "hang" when approaching a picture for the first time.

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

No branches or pull requests

1 participant