Effacer les filtres
Effacer les filtres

3d representation of GPS coordinates

11 vues (au cours des 30 derniers jours)
marianoc84
marianoc84 le 22 Mai 2011
[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?

Réponses (2)

Ben Mitch
Ben Mitch le 22 Mai 2011
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 commentaires
marianoc84
marianoc84 le 22 Mai 2011
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 le 25 Mai 2011
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);

Connectez-vous pour commenter.


Jarrod Rivituso
Jarrod Rivituso le 22 Mai 2011
Hmmm... does stem3 help?
t = 0:0.01:pi;
x = sin(t);
y = cos(t);
z = t;
stem3(x,y,z)
  1 commentaire
marianoc84
marianoc84 le 22 Mai 2011
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?

Connectez-vous pour commenter.

Catégories

En savoir plus sur Just for fun dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by