File Exchange

image thumbnail

Figure Rotator

version 1.1.0.1 (7.23 KB) by

Allows a user to easily navigate around a target point in a 3D figure using a mouse.

2 Downloads

Updated

View License

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.
Example:

peaks;
f = FigureRotator(gca());

Try 'help FigureRotator' for more examples or see example_figure_rotator.m for an example involving smooth motion during animation.

Comments and Ratings (7)

amatuercoder

Great tool!...is there a way to get this to zoom in on the current mouse position in the figure?

amatuercoder

Would anybody know how to incorporate a camlight update within this? Something like

camlight(camlight_handle,'right')

everytime you clicked the mouse.

Johannes Korsawe

Ingenious. Why isn't this original MATLAB functionality?

John

John (view profile)

Tucker McClure

Hi Mohamed,

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!

Thanks again.

Hi Tucker,
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.

Oliver Woodford

I like that it uses the scroll wheel.
Here's yet another:
http://www.mathworks.co.uk/matlabcentral/fileexchange/38019-figure-control-widget

Updates

1.1.0.1

Updated license

1.1

Updated for new R2014b graphics system.

MATLAB Release
MATLAB 8.0 (R2012b)
Acknowledgements

Inspired: Figure control widget, VoxelPlotter

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video