有没有我可以用来创建 I.S.S 的真实图表的 matlab 函数?
Is there a matlab function(s) I can use to create a realistic diagram of the I.S.S?
作为我目前正在进行的项目的一部分,我必须解决环绕地球的国际space站的二体问题。到目前为止,我已经通过使用 sphere/surf 函数设法对此进行了近似,但是,我想知道是否有任何方法可以创建一个更逼真的代表国际空间站的图形?不幸的是,这个项目只能通过 MATLAB 完成,所以我不能使用任何其他可以提供更好可视化的工具
NASA 有许多物体的 3D 模型,包括国际空间站,which can be found here. This file can be converted to an STL however you want, I found this random website 对我有用。
在 Matlab 中,您可以通过
读取此文件
stl = stlread('isscombined.stl');
V = stl.Points;
F = stl.ConnectivityList
然后,您可以使用
绘制它
p = patch('vertices',V,'faces',F,'FaceColor',[.8 .8 .8]);
然后您可以在空间站绕地球运行时使用新的顶点位置更新对象。显然,您还可以通过将顶点乘以一定数量来缩放对象。如果您不想绘制小平面边缘,您还可以将 'EdgeAlpha', 0
添加到 patch
选项中。
这是一个简单的例子,显示了国际空间站围绕一个球体运行
% Note: not to scale
ISS_radius = 2; % distance from center of Earth
RE = 1; % radius of earth
theta = 0:.05:2*pi;
x = ISS_radius*cos(theta);
y = ISS_radius*sin(theta);
stl = stlread('isscombined.stl');
r = .01; % scaling factor
V = stl.Points * r;
V = V - mean(V); % center at origin
F = stl.ConnectivityList;
figure; hold on;
plot3(x,y,zeros(numel(theta)),'--');
[X,Y,Z] = sphere(50);
surf(RE*X,RE*Y,RE*Z,'FaceColor',[0 0 .8],'EdgeAlpha',0);
p = patch('Vertices', V*r, 'Faces', F, 'FaceColor', [0 0 0], 'EdgeAlpha', 0);
axis equal;
set(gca,'View',[200 13])
grid on;
counter = 1;
while true
p.Vertices = V + [x(counter), y(counter), 0];
pause(0.01);
drawnow
counter = mod(counter + 1, numel(theta)) + 1;
axis([-1 1 -1 1 -1 1]*ISS_radius*1.2)
end
作为我目前正在进行的项目的一部分,我必须解决环绕地球的国际space站的二体问题。到目前为止,我已经通过使用 sphere/surf 函数设法对此进行了近似,但是,我想知道是否有任何方法可以创建一个更逼真的代表国际空间站的图形?不幸的是,这个项目只能通过 MATLAB 完成,所以我不能使用任何其他可以提供更好可视化的工具
NASA 有许多物体的 3D 模型,包括国际空间站,which can be found here. This file can be converted to an STL however you want, I found this random website 对我有用。
在 Matlab 中,您可以通过
读取此文件stl = stlread('isscombined.stl');
V = stl.Points;
F = stl.ConnectivityList
然后,您可以使用
绘制它p = patch('vertices',V,'faces',F,'FaceColor',[.8 .8 .8]);
然后您可以在空间站绕地球运行时使用新的顶点位置更新对象。显然,您还可以通过将顶点乘以一定数量来缩放对象。如果您不想绘制小平面边缘,您还可以将 'EdgeAlpha', 0
添加到 patch
选项中。
这是一个简单的例子,显示了国际空间站围绕一个球体运行
% Note: not to scale
ISS_radius = 2; % distance from center of Earth
RE = 1; % radius of earth
theta = 0:.05:2*pi;
x = ISS_radius*cos(theta);
y = ISS_radius*sin(theta);
stl = stlread('isscombined.stl');
r = .01; % scaling factor
V = stl.Points * r;
V = V - mean(V); % center at origin
F = stl.ConnectivityList;
figure; hold on;
plot3(x,y,zeros(numel(theta)),'--');
[X,Y,Z] = sphere(50);
surf(RE*X,RE*Y,RE*Z,'FaceColor',[0 0 .8],'EdgeAlpha',0);
p = patch('Vertices', V*r, 'Faces', F, 'FaceColor', [0 0 0], 'EdgeAlpha', 0);
axis equal;
set(gca,'View',[200 13])
grid on;
counter = 1;
while true
p.Vertices = V + [x(counter), y(counter), 0];
pause(0.01);
drawnow
counter = mod(counter + 1, numel(theta)) + 1;
axis([-1 1 -1 1 -1 1]*ISS_radius*1.2)
end