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

조회 수: 5 (최근 30일)
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 CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by