Repository navigation
Conversation
cdata
suggested changes
Aug 29, 2019
cdata
left a comment
Contributor
There was a problem hiding this comment.
Looks really good. I really love the look of zooming now. A few bike-shed-y tweaks requested 🙇
|
|
||
| test('defaults FOV correctly', async () => { | ||
| expect(element.getFieldOfView()).to.be.equal(DEFAULT_FOV); | ||
| expect(element.getFieldOfView()).to.be.closeTo(DEFAULT_FOV, 0.00001); |
| maximumAzimuthalAngle?: number; | ||
| // The minimum camera field of view in degrees | ||
| minimumFov?: number; | ||
| minimumLogFov?: number; |
Contributor
There was a problem hiding this comment.
Separately, its incongruous for us to ask the user to think about "log field of view" here when configuring the controls, but separately set field of view directly in a method like setFov. It seems like we could get away with asking the user to set a desired range in degrees and we could log(fov) as an internal detail.
| @@ -280,13 +280,17 @@ suite('SmoothControls', () => { | |||
| test('does not zoom when scrolling while blurred', () => { | |||
Contributor
There was a problem hiding this comment.
Let's add test coverage for configuring min/max field of view.
Merged
cdata
approved these changes
Aug 30, 2019
| }); | ||
| }); | ||
|
|
||
| suite('field of view', () => { |
Contributor
|
Amazing!! |
elalish
added a commit
to elalish/model-viewer
that referenced
this pull request
Feb 4, 2020
Zoom using FoV (google#729) * switch zoom from radius to FOV * made perceptually linear * fixed tests * addressing feedback
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #542
In addition to zooming using FoV instead of radius, I also interpolate using log(FoV) in order to make it perpetually linear (same movement is the same fractional change from any starting point). I also narrowed the minimum so you can get closer to the object, since you can never enter it now.