3d representation of GPS coordinates

조회 수: 5 (최근 30일)
marianoc84 2011년 5월 22일
[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
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
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일
It sounds like more than a starting point...
There's only one open issue: how to set a colormpa rather than solid color [0 1 1]?
Ben Mitch
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
Jarrod Rivituso 2011년 5월 22일
Hmmm... does stem3 help?
t = 0:0.01:pi;
x = sin(t);
y = cos(t);
z = t;
  댓글 수: 1
marianoc84 2011년 5월 22일
It seems.
The really hard question (for me) is: how should I join with a segment single stem's point, how should I color the surface obtained joining the the points?

댓글을 달려면 로그인하십시오.


Help CenterFile Exchange에서 Just for fun에 대해 자세히 알아보기


Community Treasure Hunt

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

Start Hunting!

Translated by