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

Cleanup projection code #3013

Open
ffreyer opened this issue Jun 16, 2023 · 1 comment
Open

Cleanup projection code #3013

ffreyer opened this issue Jun 16, 2023 · 1 comment
Labels
CairoMakie This relates to CairoMakie, the vector backend for Makie based on Cairo. cleanup enhancement Feature requests and enhancements GLMakie This relates to GLMakie.jl, the OpenGL backend for Makie. Makie Backend independent issues (Makie core) transformation related to `Transformation` objects WGLMakie This relates to WGLMakie.jl, the Web-based WebGL backend for Makie.

Comments

@ffreyer
Copy link
Collaborator

ffreyer commented Jun 16, 2023

We have quite a bit of code that deals with projecting positional data from one space to another. I think there is a fair amount of duplicate code in this, which would be good to remove/unify. The project methods also need to be clearer about what they do I think.

In terms of clarity it might be good to keep project(cam, input_space, output_space, pos) and add more space options to exhaust all the options. It might also be nice to allow input_space => output_space as an argument here.


In https://github.com/MakieOrg/Makie.jl/blob/master/src/camera/projection_math.jl we have to_world and various project methods which aren't all that clear. These all ignore model and transform_func.

In https://github.com/MakieOrg/Makie.jl/blob/master/src/basic_recipes/error_and_rangebars.jl we have scene_to_screen and screen_to_scene which functionally match project. After #3012 these will be changed to plot_to_screen and screen_to_plot and include model and transform_func.

GLMakie has some code doing a full plot space -> screen space projection without using project at all in https://github.com/MakieOrg/Makie.jl/blob/master/GLMakie/src/drawing_primitives.jl (lines).

CairoMakie defines its own project functions in https://github.com/MakieOrg/Makie.jl/blob/master/CairoMakie/src/utils.jl which are used instead of Makie's project.

@ffreyer
Copy link
Collaborator Author

ffreyer commented Jun 17, 2023

Adjacent to this, we still apply model transformations if space != :data.

@ffreyer ffreyer added enhancement Feature requests and enhancements Makie Backend independent issues (Makie core) GLMakie This relates to GLMakie.jl, the OpenGL backend for Makie. WGLMakie This relates to WGLMakie.jl, the Web-based WebGL backend for Makie. CairoMakie This relates to CairoMakie, the vector backend for Makie based on Cairo. transformation related to `Transformation` objects cleanup labels Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CairoMakie This relates to CairoMakie, the vector backend for Makie based on Cairo. cleanup enhancement Feature requests and enhancements GLMakie This relates to GLMakie.jl, the OpenGL backend for Makie. Makie Backend independent issues (Makie core) transformation related to `Transformation` objects WGLMakie This relates to WGLMakie.jl, the Web-based WebGL backend for Makie.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant