I’m on 0.22.2 and this works:
using Makie
using GeometryBasics
using Colors
struct Sprite{T<:RGB,T2<:Integer,T3<:Point3,T5<:Vec3}
points::Vector{T3}
faces::Vector{TriangleFace{T2}}
normals::Vector{T5}
uv::Vector{Vec2f}
img::Matrix{T}
end
"""
Map `img` onto a flat 3D surface
"""
function sprite(img, rect=Rect2(-0.5, -0.5, 1.0, 1.0))
points = decompose(Point3f, rect)
normals = decompose(GeometryBasics.Normal(Vec3f), rect)
faces = decompose(GLTriangleFace, rect)
uv = decompose(UV(Vec2f), rect)
Sprite(points, faces, normals, uv, img)
end
function Makie.convert_arguments(::Type{<:AbstractPlot}, sp::Sprite)
gb_mesh = GeometryBasics.Mesh(sp.points, sp.faces; uv=sp.uv, normal=sp.normals) # this does not error, but I can't see the image
# gb_mesh = GeometryBasics.Mesh(GeometryBasics.meta(sp.points; uv=sp.uv, sp.normals), sp.faces) # this used to work, but now errors.
PlotSpec(Makie.Mesh, gb_mesh, color=sp.img)
end
plot(sprite(rand(RGBf, 100, 100)))