Adding textures to rectangles using Makie

question

#1

I want to create a number of textured (rotated) rectangles where the 3D corner coordinates are given in a single plot using Makie.jl or GLVizualize. I want a plot similar to this example where the earth image is plotted onto the sphere here https://gist.github.com/SimonDanisch/8f5489cffaf6b89c9a3712ba3eb12a84 , but this time the images should be plotted these rectangles.

I tried adding a texture to either a HyperRectangle or a Polygon types from the GeomtryTypes package, but don;t really understand how these interact with the different mesh types etc, so an MWE that produces such a plot would be super helpful.


#2

I had to add a fix, but this should work on latest master of Makie:

using Makie, GeometryTypes, Colors
scene = Scene()
doge = GLVisualize.loadasset("doge.png")
# For rectangles + rotation
scatter(
    Point3f0[(1,0,0), (0,1,0), (0,0,1)],
    marker = [doge, doge, doge],
    # rotation around axis... can use Vec4f0(...) for a quaternion directly
    rotations = [(Vec3f0(0, 1, 0), 0.5pi), (Vec3f0(1, 0, 0), -0.5pi), (Vec3f0(0, 0, 1), -1.2pi)]
)

# for more control:
scene = Scene(resolution = (500, 500))
mesh = GLNormalUVMesh(SimpleRectangle(0, 0, 1, 1))
# note, you can change the mesh.vertices to arbitrary values
Makie.mesh(mesh, color = doge, shading = false)
center!(scene)

#3

woops, didn’t noticed that the push didn’t go through! Should be pushed now: