Applying 3d transformation to cuboid

조회 수: 2 (최근 30일)
2one
2one 2017년 7월 14일

I have the 8 vertices of a cuboid (XYZvox) with known distance in millimetres (vox to mm) between each vertex which I transform in 3d space using the following 4d transformation matrix (M). I am really struggling to work out the new voxel to millimetre conversion for the transformed vertices. How can I work this out?

XYZvox =[ 1     1     1     1   409   409   409   409
     1     1   389   389     1     1   389   389
     1   162     1   162     1   162     1   162]
M =[0.0337    0.0958   -0.9616   -2.5360
    0.3706    0.0107    0.1012 -150.2009
    0.0201   -0.3571   -0.2550 -231.0513
         0         0         0    1.0000]
for i=1:8
poi1=XYZvox(:,i);
poi2=[XYZvox(:,i)];
poi2(4,1)=1;
poi_trans=M*poi2;
poi_trans=poi_trans(1:3);
scatter3(poi1(1),poi1(2),poi1(3),'red','filled'); xlabel('x'); hold all;
scatter3(poi_trans(1),poi_trans(2),poi_trans(3),'green','filled'); xlabel('x'); ylabel('y'); zlabel('z'); 
end

답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by