23.12.2012 Views

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

camorbit<br />

2camorbit<br />

Purpose Rotate the camera position around the camera target<br />

Syntax camorbit(dtheta,dphi)<br />

camorbit(dtheta,dphi,'coordsys')<br />

camorbit(dtheta,dphi,'coordsys','direction')<br />

camorbit(axes_handle,...)<br />

Description camorbit(dtheta,dphi) rotates the camera position around the camera target<br />

by the amounts specified in dtheta and dphi (both in degrees). dtheta is the<br />

horizontal rotation and dphi is the vertical rotation.<br />

2-194<br />

camorbit(dtheta,dphi,'coordsys') The coordsys argument determines the<br />

center of rotation. It can take on two values:<br />

• data (default) – rotate the camera around an axis defined by the camera<br />

target and the direction (default is the positive z direction).<br />

• camera – rotate the camera about the point defined by the camera target.<br />

camorbit(dtheta,dphi,'coordsys','direction') The direction<br />

argument, in conjunction with the camera target, defines the axis of rotation<br />

for the data coordinate system. Specify direction as a three-element vector<br />

containing the x, y, and z-components of the direction or one of the characters,<br />

x, y, or z, to indicate [1 0 0], [0 1 0], or [0 0 1] respectively.<br />

camorbit(axes_handle,...) operates on the axes identified by the first<br />

argument, axes_handle. When you do not specify an axes handle, camorbit<br />

operates on the current axes.<br />

Examples Compare rotation in the two coordinate systems with these for loops. The first<br />

rotates the camera horizontally about a line defined by the camera target point<br />

and a direction that is parallel to the y-axis. Visualize this rotation as a cone<br />

formed with the camera target at the apex and the camera position forming the<br />

base:<br />

surf(peaks)<br />

axis vis3d<br />

for i=1:36<br />

camorbit(10,0,'data',[0 1 0])<br />

drawnow

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!