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.

camlookat<br />

2camlookat<br />

Purpose Position the camera to view an object or group of objects<br />

Syntax camlookat(object_handles)<br />

camlookat(axes_handle)<br />

camlookat<br />

Description camlookat(object_handles) views the objects identified in the vector<br />

object_handles. The vector can contain the handles of axes children.<br />

2-192<br />

camlookat(axes_handle) views the objects that are children of the axes<br />

identified by axes_handle.<br />

camlookat views the objects that are in the current axes.<br />

Remarks camlookat moves the camera position and camera target while preserving the<br />

relative view direction and camera view angle. The object (or objects) being<br />

viewed roughly fill the axes position rectangle.<br />

camlookat sets the axes CameraPosition and CameraTarget properties.<br />

Examples This example creates three spheres at different locations and then<br />

progressively positions the camera so that each sphere is the object around<br />

which the scene is composed:<br />

[x y z] = sphere;<br />

s1 = surf(x,y,z);<br />

hold on<br />

s2 = surf(x+3,y,z+3);<br />

s3 = surf(x,y,z+6);<br />

daspect([1 1 1])<br />

view(30,10)<br />

camproj perspective<br />

camlookat(gca) % Compose the scene around the current axes<br />

pause(2)<br />

camlookat(s1) % Compose the scene around sphere s1<br />

pause(2)<br />

camlookat(s2) % Compose the scene around sphere s2<br />

pause(2)<br />

camlookat(s3) % Compose the scene around sphere s3<br />

pause(2)<br />

camlookat(gca)

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

Saved successfully!

Ooh no, something went wrong!