Visualise 3D trajectory data as a volume plot
4 ビュー (過去 30 日間)
古いコメントを表示
I have 3D trajectory data (x, y, z coordinates) which I would like to visualise as a volume plot. I'm using plot3 but just getting a line plot - see attached pdf with images of what I'm getting using plot3 and what I would like to get.
I've also attached a .mat file containing my 3D-trajectory data.
Many thanks for your help.
2 件のコメント
採用された回答
KSSV
2018 年 7 月 26 日
編集済み: KSSV
2018 年 7 月 27 日
Check the below trial code:
S = matfile('C:\Users\srinivas\Downloads\3DTraj.mat') ;
x = S.xSmooth ;
y = S.ySmooth ;
z = S.zSmooth ;
x = x(1:5:end) ; y = y(1:5:end) ; z = z(1:5:end) ;
N = [diff(x) diff(y) diff(z)] ;
C = 20*ones(size(x)) ;
figure
hold on
plot3(x,y,z,'r')
Cx = zeros([],[]) ;
Cy = zeros([],[]) ;
Cz = zeros([],[]) ;
for i = 1:1:length(x)-1
center = [x(i) y(i) z(i)] ;
normal = [N(i,1) N(i,2) N(i,3)] ;
radius = C(i) ;
P = plotCircle3D(center,normal,radius) ;
Cx(i,:) = P(1,:);
Cy(i,:) = P(2,:);
Cz(i,:) = P(3,:);
end
h = mesh(Cx,Cy,Cz) ; shading interp
h.FaceAlpha = 0.5 ;
Download the functions from the link:
5 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で 3-D Volumetric Image Processing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!