This is what I’ve got for keeping my 3D scene pointed at the origin. It seems a bit janky, is there a better way?
function lookcenter(scene, stopper)
@async begin
while !stopper[] && isopen(scene)
sleep(0.25)
ep = scene.camera.eyeposition[]
update_cam!(scene, ep, Vec3f0(0))
end
end
end
stopper = Ref(false)
lookcenter(scene, stopper)
# to end the task later:
stopper[] = true
You can adjust pan_button as a keyword argument to cam3d_cad!. I think the way it’s implemented you could set it to Keyboard.left_control, for example, and it would trigger when you press left control and hold any mouse button down. There’s also move_key which is an additional you’d have to press, though that applies to both rotating and panning.
Relatedly, I’d like if possible to have zooming via the mouse (2-finger drag up/down, equivalent to mouse wheel) also not modify the lookat position. Or maybe better would be for it to operate along the vector from eyeposition to lookat position.
Obviously it can be done with Observables but that seems like an option of last resort.
Edit: Actually, never mind. I was using cam3d! not cam3d_cad. With the latter it has the zoom behavior I’m looking for.