What is the 3D plotter package closest to the rgl R package?

Hello,

I took a look at the available 3D plotter package in Julia but at first glance they look complicated to me (maybe I mislooked). I’m looking for a package similar to the rgl R package, that is, you just have to enter the vertices coordinates and the indices of the triangle vertices. Is there such a package in Julia? I’m also comfortable with the Pyvista Python package.

isn’t that just GLMakie? with some extra steps if you want with GeometryBasics.jl · GeometryBasics.jl (not needed for basics stuff)

https://juliadatascience.io/glmakie

some extra geometry examples can be found here: https://github.com/lazarusA/100daysOfMakie#21-meshes

1 Like

Sorry but I understand nothing to the docs. Can someone show me a basic example, e.g. a tetrahedron or a cube?

A cube:

using GLMakie
mesh(Rect3f(Vec3f(-0.5), Vec3f(1)); color = :red)

of course you need to install GLMakie first.

Also, a pyramid

using GLMakie, GeometryBasics
mesh(Pyramid(Point3f(0), 1.0f0, 1.0f0); color = :gold, transparency =true)
wireframe!(Pyramid(Point3f(0), 1.0f0, 1.0f0); color=:black, 
    linewidth = 2, transparency = true)
current_figure()

2 Likes

Thanks, and sorry for the late reply.

Here you use built-in functions Pyramid and Rect3f. Is it not possible to simply enter the vertices and the faces (given by vertex indices)?

It is possible to provide the mesh vertices and faces, but I think the interface only supports triangular faces at the moment mesh.
See this issue for additional info `mesh` fails on quadrilateral mesh · Issue #1677 · JuliaPlots/Makie.jl · GitHub

Thank you. There’s an example. Looks like one cannot specify the per-vertex normals.

Wouldn’t this fit your needs, especially this line suggests to me that per-point normals are being passed in:

gb_mesh = GeometryBasics.Mesh(meta(points; uv=uv_buff, normals), faces)

https://makie.juliaplots.org/stable/examples/plotting_functions/mesh/#using_geometrybasicsmesh_and_buffersampler_type