3D projection

Source code Author Update time

using Plots
pythonplot()

3D plots projection: orthographic (isometric) and perspective (fps).

x = [[-1, 1], [-1, -1], [-1, 1], [1, 1], [1, 1], [-1, -1], [-1, -1], [1, 1], [-1, 1], [-1, -1], [-1, 1], [1, 1]]
y = [[1, 1], [-1, 1], [-1, -1], [-1, 1], [1, 1], [1, 1], [-1, -1], [-1, -1], [1, 1], [-1, 1], [-1, -1], [-1, 1]]
z = [[1, 1], [1, 1], [1, 1], [1, 1], [-1, 1], [-1, 1], [-1, 1], [-1, 1], [-1, -1], [-1, -1], [-1, -1], [-1, -1]]
kw = (aspect_ratio = :equal, label = :none, xlabel = "x", ylabel = "y", zlabel = "z", xlims = (-1.1, 1.1), ylims = (-1.1, 1.1), zlims = (-1.1, 1.1))
plot(plot(x, y, z; proj_type = :ortho, title = "orthographic (isometric)", camera = (45, round(atand(1 / √2); digits = 3)), kw...), plot(x, y, z; proj_type = :persp, title = "perspective (fps)", camera = (0, 0), kw...))
2024-11-13T18:13:25.697538 image/svg+xml Matplotlib v3.9.1, https://matplotlib.org/

This page was generated using DemoCards.jl and Literate.jl.