How i will draw circle around specific point in 3D model

15 ビュー (過去 30 日間)
Radoslaw Fulek
Radoslaw Fulek 2021 年 5 月 21 日
I have this function creating 3d model of the Earth
function EARTH_SPHERE(BGCOLOR,GRID)
load EARTH_MAP.mat
a = 6378137; % Horizontial radius
b = 6356752.31424518; % Vertical radius
th=repmat((0:.25:180)'*pi/180,[1 1441]);
ph=repmat((-180:.25:180)*pi/180,[721 1]);
s.children(1).properties.XData = a*sin(th).*cos(ph);
s.children(1).properties.YData = a*sin(th).*sin(ph);
s.children(1).properties.ZData = b*cos(th);
s.children(1).properties.CData = double(c)/255;
if strcmp(GRID,'on')== 1
for n=6:8
s.children(n).properties.XData = a*s.children(n).properties.XData;
s.children(n).properties.YData = a*s.children(n).properties.YData;
s.children(n).properties.ZData = b*s.children(n).properties.ZData;
end;
end;
figure;
struct2handle(s,gcf);
axis equal
axis vis3d
set(gcf,'color',BGCOLOR,'renderer','zbuffer','inverthardcopy','off');
set(gcf,'Position', [0 0 1024 1024]);
on second program I callback that function
EARTH_SPHERE([1 1 1],'on');
and I would like to create a circle on surface around certain point with specified by me radius
Something like that:

採用された回答

Christopher McCausland
Christopher McCausland 2021 年 5 月 21 日
Hi Radoslaw,
There are a couple of similar questions that answer your question. Here is a link as to how to plot circles.
I am also wondering if you need to account for the curvature, if so it should be possiable to draw the circle first and then project it onto "EARTH_SPHERE" again i'm not sure if you require this or not.
Christopher
  2 件のコメント
Radoslaw Fulek
Radoslaw Fulek 2021 年 5 月 24 日
How it would look like without curvature of sphere, because now I have no clue about projecting pre-drawn circle into sphere's exact point with good lean angle towards surface?
Christopher McCausland
Christopher McCausland 2021 年 5 月 26 日
Hi Rasoslaw,
Appologies I didn't see your reply sooner. Without considering the curvature you would get a perfect circle, considering the curvature I imagine the shape would be slightly more oval shaped. Whether to consider this curvature completly depends what you need. Let me know if you got the convetional circle in okay and if that does what you need it too. If not we can have a think about the sphere projection.
Christopher

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by