I’ve been trying to use transformation so I can change one property of an Axis3 without rotating all the content individually.
I have this function:
function rotate_axis(ax::Axis3)
ax.scene.transformation.rotation[] = Quaternion(cos(pi/4),0,sin(pi/4),0)
# ax.limits[] = ax.limits[][[5,6,3,4,1,2]]
nothing
end
I have to comment out the limits change, otherwise the transformation is reset. If I resize the GLMakie window, the transformation is reset. Is there a better way to set this transformation such that it doesn’t reset?
Rotating the entire axis would also work - I didn’t realise that would be possible. I just went searching through the attributes of ax and ax.scene and found ax.scene.transformation
Rotating the contents and changing the limits was just my approach:
I realised I can switch the limits first and then do the transformation so the transformation sticks, but if I resize the GLMakie window the transformation is lost:
Ah sorry, yeah that’s what I mean. Everything is generally oriented with the z axis in my code. For visualisation purposes I’d like to show things aligned with x axis
Maybe it could also be useful to give Axis3 an attribute by which the directions of the three axes can be chosen. Something like :xyz, :xzy, :zxy or so