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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

viewmtxT = viewmtx(az,el,phi,xc) returns the perspective transformation matrixusing xc as the target point within the normalized plot cube (i.e., the camera islooking at the point xc). xc is the target point that is the center of the view. Youspecify the point as a three-element vector, xc = [xc,yc,zc], in the interval[0,1]. The default value is xc = [0,0,0].RemarksExamplesA four-dimensional homogenous vector is formed by appending a 1 to thecorresponding three-dimensional vector. For example, [x,y,z,1] is thefour-dimensional vector corresponding to the three-dimensional point [x,y,z].Determine the projected two-dimensional vector corresponding to thethree-dimensional point (0.5,0.0,—3.0) using the default view direction. Notethat the point is a column vector.A = viewmtx(—37.5,30);x4d = [.5 0 —3 1]';x2d = A∗x4d;x2d = x2d(1:2)x2d =0.3967—2.4459Vectors that trace the edges of a unit cube arex = [0 1 1 0 0 0 1 1 0 0 1 1 1 1 0 0];y = [0 0 1 1 0 0 0 1 1 0 0 0 1 1 1 1];z = [0 0 0 0 0 1 1 1 1 1 1 0 0 1 1 0];2-579

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

Saved successfully!

Ooh no, something went wrong!