I have the following code:
using GeometryBasics, GLMakie
const SCALE = 1.2
const SEGMENTS = 7 # number of tether segments
function create_coordinate_system(scene, points = 10, length = 10)
# create y-axis in green
points -= 3
mesh!(scene, Cylinder(Point3f0(0, -(points+1) * SCALE, 0), Point3f0(0, (points+1) * SCALE , 0), Float32(0.05 * SCALE)), color=:green)
for i in range(0, length=10)
start = Point3f0(0, (points+1 + 0.07 * (i-0.5)) * SCALE, 0)
stop = Point3f0(0, (points+1 + 0.07 * (i+0.5)) * SCALE, 0)
mesh!(scene, Cylinder(start, stop, Float32(0.018 * (10 - i) * SCALE)), color=:green)
end
end
function main()
scene, layout = layoutscene(resolution = (840, 900), backgroundcolor = RGBf0(0.7, 0.8, 1))
scene3D = LScene(scene, scenekw = (show_axis=false, limits = Rect(-7,-10.0,0, 11,10,11), resolution = (800, 800)), raw=false)
create_coordinate_system(scene3D)
cam = cameracontrols(scene3D.scene)
cam.lookat[] = [0,0,5]
cam.eyeposition[] = [-15,-15,5]
update_cam!(scene3D.scene)
layout[1, 1] = scene3D
layout[2, 1] = buttongrid = GridLayout(tellwidth = false)
buttongrid[1, 1:1] = [Button(scene, label = "RESET")]
text!(scene3D, "12345", position = Point2f0(0, 0), textsize = 30, align = (:left, :bottom), show_axis = false, space = :screen)
text!(scene, "54321", position = Point2f0(0, 200), textsize = 30, align = (:left, :bottom), show_axis = false, space = :screen)
display(scene)
return nothing
end
It creates the attached graph. I tried two ways to display text, first to plot it on scene3D and in the second line to plot it on scene. If I plot it on scene3D it gets distorted, and if I plot it on scene the 3D scene hides the text that is behind it.
How can I draw undistorted text that is not hidden?