diff --git a/examples/mino-time-example.jl b/examples/mino-time-example.jl index e25a69a..5a56ec1 100644 --- a/examples/mino-time-example.jl +++ b/examples/mino-time-example.jl @@ -100,7 +100,14 @@ lines_to_plot = Krang.generate_ray.(camera.screen.pixels, 5_000) sphere = GLMk.Sphere(GLMk.Point(0.0,0.0,0.0), horizon(metric)) GLMk.mesh!(ax, sphere, color=:black) # Sphere to represent black hole -for i in lines_to_plot; GLMk.lines!(ax, i) end +for i in lines_to_plot; + ray = map(x-> begin + (;rs, θs, ϕs) = x + [rs*sin(θs)*cos(ϕs), rs*sin(θs)*sin(ϕs), rs*cos(θs)] + end, i) + ray = hcat(ray...) + GLMk.lines!(ax, ray) +end fig GLMk.save("mino_time_rays.png", fig) diff --git a/examples/raytracing-mesh-example.jl b/examples/raytracing-mesh-example.jl index 8a73ad9..9bea3e2 100644 --- a/examples/raytracing-mesh-example.jl +++ b/examples/raytracing-mesh-example.jl @@ -74,7 +74,8 @@ recording = GLMk.record(fig, "mesh.mp4", 1:sze*sze, framerate=120) do i GLMk.mesh!(a, sphere, color=:black) end - GLMk.lines!(ax3, line, color=:red) + cart_line = map(x->(x.rs*sin(x.θs)*cos(x.ϕs), x.rs*sin(x.θs)*sin(x.ϕs), x.rs*cos(x.θs)), line) + GLMk.lines!(ax3, cart_line, color=:red) GLMk.heatmap!(ax, img, colormap=:afmhot, colorrange=(0, 8)) end # ```@raw html diff --git a/gpu_examples/Project.toml b/gpu_examples/Project.toml index 2cac149..77a7a63 100644 --- a/gpu_examples/Project.toml +++ b/gpu_examples/Project.toml @@ -1,5 +1,6 @@ [deps] CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0" GLMakie = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a" +KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c" Krang = "54806c32-d51a-438d-8447-e0041be2fbfb" Metal = "dde4c033-4e86-420c-a63e-0dd931031962" diff --git a/src/materials/ElectronSynchrotronPowerLawIntensity.jl b/src/materials/ElectronSynchrotronPowerLawIntensity.jl index 929ba28..1e599cf 100644 --- a/src/materials/ElectronSynchrotronPowerLawIntensity.jl +++ b/src/materials/ElectronSynchrotronPowerLawIntensity.jl @@ -115,4 +115,4 @@ function (linpol::ElectronSynchrotronPowerLawIntensity{N,T})(pix::AbstractPixel, return norm^(1 + spectral_index) * lp * prof end isFastLight(material::ElectronSynchrotronPowerLawIntensity) = true -isAxisymmetric(material::ElectronSynchrotronPowerLawIntensity) = false \ No newline at end of file +isAxisymmetric(material::ElectronSynchrotronPowerLawIntensity) = true \ No newline at end of file