-
-
Notifications
You must be signed in to change notification settings - Fork 313
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
Documentation doesn't explain well the model matrix things #2637
Comments
I would personally prefer if we pushed against using |
+1 for better documentation for |
Another +1 for better documentation (and maybe even an updated implementation). Following up on #4445, I too can't figure out what the origin is for those toggles. I looked at all of the parent models and they are all identity matrices implying that the toggle should be drawn at the origin (0, 0), but it obviously isn't. So what transform is translating it to the middle of the screen?
I would expect at least one of the above matrices to contain the translation. Am I missing one? As a suggestion to the translate/roatate API's, it would be helpful to have the following: |
Transformations affect plots, not scenes. At least not directly. Effectively Makie ends up calculating plot.model * apply_transform(plot.transformation.transform_func, plot.converted) where things default as t = plot.transformation
plot.model = t.model = t.parent.model * transformationmatrix(t.translation, t.scale, t.rotation)
t.transform_func = t.parent.transform_func So if you translate/rotate/scale a scene and a plot in that scene those transformation will accumulate. The origin of rotation etc is 0 in your plot input data (well technically after transform_func). For Toggle you're rendering to a pixel space scene (blockscene) with no transform_func. The plots that make up the toggle (poly, scatter) are therefore also in pixel space. (0, 0, 0) is at the bottom left of the window (or more specifically the blockscene, which is the same size as the window). |
Many plotting functions(e.g. heatmap) have this attribute:
"model::Makie.Mat4f sets a model matrix for the plot. This replaces adjustments made with translate! , rotate! and scale! ."
I don't understand this description and cannot find any explanations in detail or any examples about how to use this attribute.
The text was updated successfully, but these errors were encountered: