-
-
Notifications
You must be signed in to change notification settings - Fork 312
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
Broken model transformations in GLMakie and WGLMakie but works in CairoMakie #2122
Comments
I assume the reason this happens is that the model transform of parent plots is not combined with the children transforms in GLMakie and WGLMakie. |
This happens because julia> p.model[]
4×4 StaticArrays.SMatrix{4, 4, Float32, 16} with indices SOneTo(4)×SOneTo(4):
0.0 0.0 1.0 4.0
1.0 0.0 0.0 0.0
0.0 1.0 0.0 0.0
0.0 0.0 0.0 1.0
julia> p.plots[1].model[]
4×4 StaticArrays.SMatrix{4, 4, Float32, 16} with indices SOneTo(4)×SOneTo(4):
1.0 0.0 0.0 0.0
0.0 1.0 0.0 0.0
0.0 0.0 1.0 0.0
0.0 0.0 0.0 1.0 |
Hm yes but do you think all child plots should have completely separate model matrices? It seems reasonable to me that one might put a child element with a special model matrix into a parent object, and then wants to give the parent a different model matrix, which should leave the relative look of the child vs the parent intact. |
That's what happens with The better solution to the above is probably using |
Ok I probably just didn't understand the system well, then. Can confirm that using this interface, I could make it work with GLMakie: using Makie.KernelDensity
x = randn(1000)
k = kde(x, npoints = 200)
f = Figure()
ax = Axis3(f[1, 1], limits = (-4, 4, -4, 4, 0, 1))
p = poly!(ax, Point2f.(k.x, k.density))
translate!(p, Point3f(0, 4, 0))
rotate!(p, Point3f(1, 0, 0), pi/2)
p = poly!(ax, Point2f.(k.x, k.density))
rotate!(p, Point3f(0, 0, 1), pi/2)
rotate!(Accum, p, Point3f(1, 0, 0), pi/2)
translate!(p, Point3f(4, 0, 0))
f |
Can we actually close this? |
I think the question here is: Should the model attribute be passed to children? If yes we may need to add If no, maybe we should stop advertising it in the plot example and instead advertise transformations. |
CairoMakie behaves like GLMakie and WGLMakie here now. After #3246 the rescaling Axis3 does has also moved to transformation.model, which makes overwriting the model matrix through plot attributes more error-prone. |
Hi,
Consider following example
Picture shows up correctly in the CairoMakie backend, but is broken in GLMakie/WGLMakie showing distribution unaffected in the middle of the plot, shown in second picture
The text was updated successfully, but these errors were encountered: