I was looking at this question, which asks to keep the orientation of some 3D graphics objects constant (relative to the viewer) while rotating the rest with the mouse. I thought that maybe the coordinates can be given in terms of the ViewPoint
and ViewVertical
, which do keep unchanged relative to the viewer. I came up with this:
DynamicModule[{vv = {0, 0, 1}, vp = {1.3`, -2.4`, 2.`}},
Graphics3D[{
Cuboid[],
Line[{{0, 0, 0}, Dynamic[vv]}]
(*,Line[{{0,0,0}, Dynamic@vp}]*)
},
ViewPoint -> Dynamic[vp],
ViewVertical -> Dynamic[vv],
Boxed -> False, SphericalRegion -> True]
]
The problem is that the updating of the Line
and the rotation of the graphics are not synchronized. The former happens with a short delay after the latter, leading to some flickering while rotating the graphics with the mouse.
How can we lock together just the display of the Line
and the rest of the graphics, to avoid this flickering?