I am trying to control the radius of a HyperSphere using Makie
textslider
s and have been unsuccessful. So I figured I would use scale!
to scale an object. But I have not seen any definition of a Makie Object. I thought that the HyperSphere
would qualify. It does not. Here is a minimal working example that does not work. (I have been able to control the size of markers. So perhaps drawing a mesh with a single sphere would do the trick. But surely, there is another method. Assume I had a cube and all I wanted to do is rotate the cube within a scene with the rest of the objects staying in fixed locations? In the days I was using OpenGL, the use of matrix stacks was useful for this purpose. Thanks for any help and advice.
using Makie, GeometryTypes, AbstractPlotting
using LightGraphs, MetaGraphs
# For some reason, `using Makie` does not import its functions.
const AP = Makie
function setupCamera!(scene)
cam = cam3d!(scene)
#cam.projectiontype[] = AbstractPlotting.Orthographic
#cam.
eyepos = Makie.Vec3f0(5, 1.5, 0.5);
lookat = Makie.Vec3f0(0., 0., 0.);
end
function makePlot()
marker_size = 0.0002
scene = Scene();
sradius, s_marker_radius = textslider(2f0.^(0.5f0:0.25f0:20f0), "light pos r", start=2f0)
sphere = Makie.Sphere(Makie.Point3f0(0), 1f0)
mesh!(scene, sphere, color=:red, scale=s_marker_radius) # HOW TO CHANGE SPHERE RADIUS?
parent_scene = Scene()
hbox(sradius, scene, parent=parent_scene)
setupCamera!(scene);
display(parent_scene)
end
# Execute the function
makePlot()