3d representation of GPS coordinates
이전 댓글 표시
[EDIT: 20110525 10:45 CDT - clarify - WDR]
I have 3 vectors, x, y, z. Three different vector's element represent the position of point in space (e.g. x[0], y[0], z[0] contain info about first point position).
Now I need to realize a 3d representation of the entire set of point, it should look like that: http://www.svgopen.org/2008/papers/38-Visualization_of_GPS_tracks_with_SVG/09_gpstrackanalyse-net_3d.png
Can someone help me??? What function should be useful?
답변 (2개)
Ben Mitch
2011년 5월 22일
If you want something looking just like the figure you posted, you'll be wanting to use patch(), I suspect. The following might be a starting point (stealing Jarrod's x/y/z source data)...
close all
t = 0:0.1:pi;
x = sin(t);
y = cos(t);
z = t+0.1;
for n = 1:length(z)-1
x1 = x(n);
x2 = x(n+1);
y1 = y(n);
y2 = y(n+1);
z1 = z(n);
z2 = z(n+1);
p = patch([x1 x2 x2 x1], [y1 y2 y2 y1], [0 0 z2 z1], [0 1 1]);
set(p, 'LineStyle', 'none');
plot3([x1 x2], [y1 y2], [z1 z2], 'b-', 'linewidth', 3);
hold on
end
view(3);
light
use image() to lay down a photo on the axis, first, if you want. look at light() if you want to make it look slicker. for annotations as shown, you'll need text() as well.
댓글 수: 2
marianoc84
2011년 5월 22일
Ben Mitch
2011년 5월 25일
here's some crude code for that. see "help patch" for details.
ci = (z2 - min(z)) / (max(z) - min(z)) * 64 + 1;
p = patch([x1 x2 x2 x1], [y1 y2 y2 y1], [0 0 z2 z1], ci);
Jarrod Rivituso
2011년 5월 22일
Hmmm... does stem3 help?
t = 0:0.01:pi;
x = sin(t);
y = cos(t);
z = t;
stem3(x,y,z)
카테고리
도움말 센터 및 File Exchange에서 Graphics Performance에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!