Skip to content
This repository has been archived by the owner on Jul 13, 2021. It is now read-only.

jk/new 3daxis attempt #649

Merged
merged 32 commits into from
Apr 3, 2021
Merged

jk/new 3daxis attempt #649

merged 32 commits into from
Apr 3, 2021

Conversation

jkrumbiegel
Copy link
Member

  • add 3d axis
  • check axis with can_be_current_axis
  • gridlines, ticks, fix inv eyepos
  • axis3 as default 3d axis
  • add ticks
  • change to ax3 for fps as well

@Datseris
Copy link
Contributor

I'm testing this locally on my own projects now. Thanks a lot, I am really desperate of unified look between 2D and 3D ;) .

This is the test code i used:

fig, ax3, surf = surface(1:100, 1:100, randn(100, 100))
display(fig)
angles = 0:0.01:2π
for angle in angles
    ax3.azimuth = angle
    sleep(0.001)
end

image

Which works really well. Two comments for now.

  1. perhaps it is better to auto-scale the axes, if the user does not explicitly provide bounds, so that they all have the same size, instead of data size indicating a much smaller axis. This is a problem the old 3D axis also has. For example, 2D plotting does not do this by default: if I plot 1:100 versus 0.00001:0.0001:0.0001, I don't get a super-stretched line as an AXis, but a square.
  2. Attempting to change GLmakie window size after the plot leads to the error:
julia> InexactError: UInt64(Inf)
Stacktrace:
 [1] UInt64 at .\float.jl:689 [inlined]
 [2] Timer(::Float64; interval::Float64) at .\asyncevent.jl:74
 [3] Timer at .\asyncevent.jl:72 [inlined]
 [4] sleep at .\asyncevent.jl:213 [inlined]
 [5] fps_renderloop(::GLMakie.Screen, ::Float64) at C:\Users\datse\.julia\packages\GLMakie\AiucZ\src\rendering.jl:32
 [6] renderloop(::GLMakie.Screen; framerate::Float64) at C:\Users\datse\.julia\packages\GLMakie\AiucZ\src\rendering.jl:48
 [7] renderloop(::GLMakie.Screen) at C:\Users\datse\.julia\packages\GLMakie\AiucZ\src\rendering.jl:41
 [8] (::GLMakie.var"#51#53"{GLMakie.Screen})() at .\task.jl:356

@jkrumbiegel
Copy link
Member Author

jkrumbiegel commented Mar 14, 2021

can you try setting ax.data_aspect = :equal for the scaling thing, it should do the different scaling behavior. The symbols are super confusing right now, :same vs :equal, but I haven't come up with good ones yet and it's all preliminary anyway

@Datseris
Copy link
Contributor

It works:

image

I would still argue that this should be the default behavior in 3D

@jkrumbiegel
Copy link
Member Author

sure I was just testing the other mode last

@Datseris
Copy link
Contributor

Datseris commented Mar 14, 2021

Calling xlims! etc. does not have a method yet for Axis3. I currently do manuyally ax3.limits[] = FRect3D(...) . Doing ax3.limits = Frect... directly also does not work, but works for 2D axis.

P.s.: If you don't like me reporting problems, let me know

@Datseris
Copy link
Contributor

Datseris commented Mar 14, 2021

For large tick labels, they cover the axis labels:
image

Furthermore, the nice gray lines that connect the ticks are not shown in this example. I have not disablerd them myself, perhaps the size is a problem.

@jkrumbiegel jkrumbiegel merged commit afcbf5b into master Apr 3, 2021
@jkrumbiegel jkrumbiegel deleted the jk/new-3daxis-attempt branch April 3, 2021 13:39
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants