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

Orbit controls revisions #1

Merged
merged 4 commits into from
Nov 11, 2023

Conversation

dylanebert
Copy link

  • Naming, formatting for consistency
  • Removed setPosition, since I believe it has the same function as setting camera.position = directly, which OrbitControls now listens for. Let me know if I'm mistaken and there is a different intended functionality
  • Update the camera-updates example to test the new method

@spark323
Copy link
Owner

spark323 commented Nov 11, 2023

Thank you, I didn't notice you had updated it to listen to the camera's position.

Aslo, It appears that there is an error in the revised version of the function.

The corrected version should be:

desiredRadius = Math.sqrt(dx * dx + dy * dy + dz * dz);
desiredBeta = Math.atan2(dy, Math.sqrt(dx * dx + dz * dz));
desiredAlpha = -Math.atan2(dx, dz);

(desiredRadius and desiredAlpha should be swapped)

Thank you.

@spark323 spark323 merged commit 355f0c6 into spark323:main Nov 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants