How can we save the color affected to a point and affect this color to another point (in 3D plot) ?
2 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I am currently working with a list of points (3d coordinates). At the beginning, I have this list of coordinates (x list, y list, z list) in a local frame and when I plot it (with plot3k for instance) I have a color assigned to each point, depending on the z-value. Then, I rotate and translate these points and I plot them again, but I want to have the same color on each point than previously (it cannot be done with plot3k directly because the color depends on the new z-value).
I was thinking of saving the color assigned to each points in the local frame (so I will have a list of colors with the same length than the list of coordinates) and then assign again to each points its color after the rotation and translation. But I don't know how to do that exactly.
Could you help me ?
At the end, my functions will look like
function color_list = getColor(z_list_frame1)
%get the color code for each z-value
end
and
function my_plot3(x_list_frame2,y_list_frame2,z_list_frame2,color_list)
%plot each point with the corresponding color
end
Thank you in advance for your help !
2 件のコメント
Image Analyst
2017 年 11 月 14 日
I don't understand your definition of "affected". The normal English definition of affected doesn't fit the context of your sentences. Just what does "affected" mean to you?
採用された回答
その他の回答 (1 件)
KSSV
2017 年 11 月 14 日
Use delaunay triangulation....to plot what you want.
dt = delaunayTriangulation(x,y) ;
REad about triplot and trisurf.
3 件のコメント
KSSV
2017 年 11 月 15 日
There are two ways to put a color......plot a mesh/ surface and put color or plot points and put color......for the first delaunay triangulation helps., for the second scatter helps.
参考
カテゴリ
Help Center および File Exchange で Surface and Mesh Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!