| Products & Services | Industries | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
| On this page… |
|---|
In the camera metaphor, a dolly is a stage that enables movement of the camera from side to side with respect to the scene. The camdolly command implements similar behavior by moving both the position of the camera and the position of the camera target in unison (or just the camera position if you so desire).
This example illustrates how to use camdolly to explore different regions of an image. It shows how to use the following functions:
ginput to obtain the coordinates of locations on the image
The camdolly data coordinates option to move the camera and target to the new position based on coordinates obtained from ginput
camva to zoom in and to fix the camera view angle, which is otherwise under automatic control
First load the Cape Cod image and zoom in by setting the camera view angle (using camva).
load cape image(X) colormap(map) axis image camva(camva/2.5)
Then use ginput to select the x- and y-coordinates of the camera target and camera position.
while 1
[x,y] = ginput(1);
if ~strcmp(get(gcf,'SelectionType'),'normal')
break
end
ct = camtarget;
dx = x - ct(1);
dy = y - ct(2);
camdolly(dx,dy,ct(3),'movetarget','data')
drawnow
end
![]() | Camera Graphics Functions | Example — Moving the Camera Through a Scene | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |