12.07.2015 Views

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

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.

camlookatPurpose2camlookatPosition the camera to view an object or group of objectsSyntaxDescriptioncamlookat(object_handles)camlookat(axes_handle)camlookatcamlookat(object_handles) views the objects identified in the vectorobject_handles. The vector can contain the handles of axes children.camlookat(axes_handle) views the objects that are children of the axesidentified by axes_handle.camlookat views the objects that are in the current axes.RemarksExamplescamlookat moves the camera position and camera target while preserving therelative view direction and camera view angle. The object (or objects) beingviewed roughly fill the axes position rectangle.camlookat sets the axes CameraPosition and CameraTarget properties.This example creates three spheres at different locations and thenprogressively positions the camera so that each sphere is the object aroundwhich the scene is composed:[x y z] = sphere;s1 = surf(x,y,z);hold ons2 = surf(x+3,y,z+3);s3 = surf(x,y,z+6);daspect([1 1 1])view(30,10)camproj perspectivecamlookat(gca) % Compose the scene around the current axespause(2)camlookat(s1) % Compose the scene around sphere s1pause(2)camlookat(s2) % Compose the scene around sphere s2pause(2)camlookat(s3) % Compose the scene around sphere s3pause(2)camlookat(gca)2-55

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

Saved successfully!

Ooh no, something went wrong!