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

Tilted fisheye projection #36

Open
bezo97 opened this issue May 23, 2024 · 4 comments
Open

Tilted fisheye projection #36

bezo97 opened this issue May 23, 2024 · 4 comments
Assignees
Labels
feature request New ideas and feature requests

Comments

@bezo97
Copy link
Owner

bezo97 commented May 23, 2024

Some planetarium domes have their projectors set up with an offset/angle away from the center. Adding an extra parameter to the fisheye projection would solve the issue. I'm not too familiar with the math so it might take a while. Here's a resource to start off with that looks useful.

The request comes from @vitos1k in this forum discussion.

@bezo97 bezo97 added the feature request New ideas and feature requests label May 23, 2024
@vitos1k
Copy link
Contributor

vitos1k commented May 23, 2024

i've succesfully added tilting into the ifs_kernel.comp.shader into project_fisheye section
It works as intended, but for now with hardcoded tilting values, because i'm not sure where to add 3 parameters (TiltX, TiltY, TiltZ) in the interface. And i'm not quite sure where in the code should i initialize those parameters

On the video bellow you can see that center of interest is tilted 30 degrees down

https://youtu.be/obu7SuASQsI

@bezo97
Copy link
Owner Author

bezo97 commented May 24, 2024

@vitos1k That's great, you did the difficult part! Send a Pull Request and I'll finish up the rest for the next release

@bezo97
Copy link
Owner Author

bezo97 commented May 26, 2024

@vitos1k After merging your PR #38 I did a tiny optimization to do the tilting on cpu instead of the shader, so it is now included in the projection matrix when the type is fisheye - see 3ac7717
Also I added sliders to the camera panel. I'm not sure if its the best there.. Let me know if you have any feedback, you can try it on the dev branch

image

@vitos1k
Copy link
Contributor

vitos1k commented May 27, 2024

@vitos1k After merging your PR #38 I did a tiny optimization to do the tilting on cpu instead of the shader, so it is now included in the projection matrix when the type is fisheye - see 3ac7717 Also I added sliders to the camera panel. I'm not sure if its the best there.. Let me know if you have any feedback, you can try it on the dev branch

image

Looks good, and works as intended! Thanks alot!
Yeah, it's better to calculate tilting once, before rendering, in projection matrix, rather than for each point in the shader, nicely done!
Sliders in camera panel are most logical placement imho

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New ideas and feature requests
Projects
None yet
Development

No branches or pull requests

2 participants