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.

viewmtxTransform the points in these vectors to the screen, then plot the object.A = viewmtx(—37.5,30);[m,n] = size(x);x4d = [x(:),y(:),z(:),ones(m*n,1)]';x2d = A*x4d;x2 = zeros(m,n); y2 = zeros(m,n);x2(:) = x2d(1,:);y2(:) = x2d(2,:);plot(x2,y2)1.61.41.210.80.60.40.20−0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8Use a perspective transformation with a 25 degree viewing angle:A = viewmtx(—37.5,30,25);x4d = [.5 0 —3 1]';x2d = A∗x4d;x2d = x2d(1:2)/x2d(4) % Normalizex2d =0.1777—1.88582-580

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

Saved successfully!

Ooh no, something went wrong!