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

Redo zoom factor implementation + revert adding Planar camera type #44

Merged
merged 7 commits into from
Nov 27, 2024

Conversation

asny
Copy link
Owner

@asny asny commented Nov 27, 2024

@thatcomputerguy0101 I had a change of mind, after testing three-d for release, I found that the changes in #40 affected more than I liked and in a very subtle way, so it's very hard for people to update to a new version. Therefore, I redid it in this PR where I'm only scaling the orthogonal camera based on the zoom factor which is again the distance between the camera position and target. Therefore, perspective cameras are not affected and in most cases, orthographic cameras are not either.

I also reverted the changes in #42 since I didn't know how to update the zoom function for that camera type. If you want to update that, I can merge it again. However, it also seems to me that it's a very special case and wouldn't be very useful for most people. Is that correct? I also made a trait for the Camera in three-d (asny/three-d#514) so now you could implement this camera type outside of three-d if you prefer that.

@asny asny merged commit 6316f4a into main Nov 27, 2024
4 checks passed
@thatcomputerguy0101
Copy link
Contributor

I've got a basic example working for #42 with the reverted zoom logic. I'll create a new PR for it soon once I clean it up and perform some more thorough testing on it.
The Viewer trait is a neat addition, but I think it is more than is necessary for the planar projection. The projection is relatively simple mathematically, and seems like it could also be useful for 3D graphs where the graph should remain roughly the same visual magnitude even if the FOV is tweaked.

@asny asny deleted the camera-improvements branch November 28, 2024 13:38
@asny
Copy link
Owner Author

asny commented Nov 29, 2024

I've got a basic example working for #42 with the reverted zoom logic. I'll create a new PR for it soon once I clean it up and perform some more thorough testing on it.

Great 👍

The Viewer trait is a neat addition, but I think it is more than is necessary for the planar projection. The projection is relatively simple mathematically, and seems like it could also be useful for 3D graphs where the graph should remain roughly the same visual magnitude even if the FOV is tweaked.

Ok, makes sense. I'll be happy to add the planar type to the camera, it just shouldn't change the other types.

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

Successfully merging this pull request may close these issues.

2 participants