The FigureRotator is a light and fast tool allowing a user to easily navigate around a target point in a 3D figure using a mouse. The camera will "orbit" a target point, move in and out, and zoom.
While these types of motion are available in MATLAB's built-in Camera Toolbar, the FigureRotator provides a combined interface allowing rotation, movement, and zooming to happen all at once by using the left mouse button for rotation, the scroll wheel for movement in and out, and the right mouse button for zooming, allowing a user to explore a 3D object more quickly. Further, the FigureRotator appears to work more quickly than the Camera Toolbar tools if the figure is also being animated.
f = FigureRotator(gca());
Try 'help FigureRotator' for more examples or see example_figure_rotator.m for an example involving smooth motion during animation.
Tucker McClure (2021). Figure Rotator (https://www.mathworks.com/matlabcentral/fileexchange/39558-figure-rotator), MATLAB Central File Exchange. Retrieved .
Great tool !
Great tool!...is there a way to get this to zoom in on the current mouse position in the figure?
Would anybody know how to incorporate a camlight update within this? Something like
everytime you clicked the mouse.
Ingenious. Why isn't this original MATLAB functionality?
Thanks for the feedback! Oliver's tool (the URL is in his comment below) includes panning. Panning could also be added directly to the FigureRotator, but I chose not to do this for a good reason. The FigureRotator is an "orbit a point" type motion instead of a "stand in a point and look around" type of motion. As such, if one was to pan around a bit, the point that one is "orbiting" becomes unclear, and getting it where one wants it might be difficult.
When I've created tools like this in the past for specific projects, I usually added "hotkeys" or something to change the orbit point (CameraTarget) from one object (say, a location on the ground) to another object (say, a satellite).
If you'd definitely like to add panning to this and aren't concerned about "losing" the orbit point, then just message me, and I can provide some tips!
Do you have an idea how panning (using the mouse) can be added?
I tried to work with 'Cameratarget','Cameraposition' and 'Cameraupvector'.... but no way.
I like that it uses the scroll wheel.
Here's yet another:
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!