How i will draw circle around specific point in 3D model
11 次查看(过去 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:
0 个评论
采纳的回答
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 个评论
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 Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!