-
-
Notifications
You must be signed in to change notification settings - Fork 267
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
feature: documentation update #223
Conversation
documentation update related with issue #215 and others one... |
Thank you so much for the update. Really helpful😊 |
readme.md
Outdated
```js | ||
const azi = 0; | ||
cameraController.addEventListener("control", (_event) => { | ||
azi = _event.target.azimuthAngle % (360 * THREE.MathUtils.DEG2RAD); | ||
}, false); | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this code example for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when you rotate to the side .azimuthAngle
is summing
0 -> 360º -> 720º -> 1080º + 45º = 1125º
now if you use rotateTo()
camera spinning back all 4x right? okey if you use this code
.azimuthAngle = .azimuthAngle % (360 * THREE.MathUtils.DEG2RAD)
you are reset 4x turns to 0 + 45º
now if you execute rotateTo()
camera rotate only -45º to 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's right.
However, I think, the code example doesn't solve the situation, because azi
is just a variable (also it should not be a const
?).
Maybe the example could be omitted at this time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm yes you right, ok no problem I change it, omitting this sample
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe can add new parameter with this function .azimuthAbsoluteAngle
what you thing about it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for understanding.
maybe can add new parameter
Thanks for your suggestion.
I think It can be done easily with THREE.MathUtils.euclideanModulo
.
Maybe it should be in user-land rather than a part of camera-controls?
e.g.
THREE.MathUtils.euclideanModulo( -2890, 360 ); // 350
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think people do not know the existence of many of the functions, which integrates in Three for that reason to be confused when using the plugin. Or they just do not understand the hierarchy of elements. You should put plugin for user Mid / Pro Level XD
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for considering the users😊
Although we already have cameraControls.normalizeRotations()
method to fix, We could add an explanation of how to normalize the accumulated angle on the user's side with THREE.MathUtils.euclideanModulo
.
Maybe like the below:
If you need a normalized accumulated azimuth angle (between 0 and 360 deg), compute with THREE.MathUtils.euclideanModulo
.
e.g.
const normalizedAzimuthAngle = THREE.MathUtils.euclideanModulo( cameraControls.azimuthAngle, 360 * THREE.MathUtils.DEG2RAD );
However, regarding adding the helper on the library side, That must be done with another github issue or PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are welcome :)
@klich3 (Let me edit a little bit after merged) |
Yes, of course, enchanted in contributing :) |
Thanks! merged! |
No description provided.