How i will draw circle around specific point in 3D model
15 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Radoslaw Fulek
il 21 Mag 2021
Commentato: Christopher McCausland
il 26 Mag 2021
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 Commenti
Risposta accettata
Christopher McCausland
il 21 Mag 2021
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 Commenti
Christopher McCausland
il 26 Mag 2021
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
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Annotations in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!