资源简介
在matlab环境下写的三维地球模型,可以自己旋转,并可模拟卫星运动轨迹
代码片段和文件信息
%% Textured 3D Earth example
%% Options
space_color = ‘k‘;
npanels = 72;
% Number of globe panels around the equator deg/panel = 360/npanels
alpha = 1;
% globe transparency level 1 = opaque through 0 = invisible
% Earth texture image
% Anything imread() will handle) but needs to be a 2:1 unprojected globe
% image.
% This is from NASA‘s Visible Earth site (http://visibleearth.nasa.gov/)
% The actual image link will likely move over time. This one is the 260KB
% version from this page: http://visibleearth.nasa.gov/view_rec.php?id=2430
% image_file = ‘http://veimages.gsfc.nasa.gov/2430/land_ocean_ice_2048.jpg‘;
image_file = ‘globe.jpg‘;
% Mean spherical earth
erad = 6371008.7714;
% equatorial radius (meters)
prad = 6371008.7714;
% polar radius (meters)
erot = 7.2921158553e-5;
% earth rotation rate (radians/sec)
%% Create figure
figure(‘Color‘ space_color);
hold on;
% Turn off the normal axes
set(gca ‘NextPlot‘‘add‘ ‘Visible‘‘off‘);
axis equal;
axis auto;
axis vis3d;
%% Create wireframe globe
% Create a 3D meshgrid of the sphere points using the ellipsoid function
[x y z] = ellipsoid(0 0 0 erad erad prad npanels);
globe = surf(x y -z ‘FaceColor‘ ‘none‘ ‘EdgeColor‘ 0.5*[1 1 1]);
%% Texturemap the globe
% Load Earth image for texture map
cdata = imread(image_file);
% Set image as color data (cdata) property and set face color to indicate
% a texturemap which Matlab expects to be in cdata. Turn off the mesh edges.
set(globe ‘FaceColor‘ ‘texturemap‘ ‘CData‘ cdata ‘FaceAlpha‘ alpha ‘EdgeColor‘ ‘none‘);
%% view
m=200;
n=30;
view(mn)
%改变初始图形的视角,第一个参数是地球沿极轴旋转的角度,为0时,美洲正对着我们,角度为正时向东
%第二个参数为地球倾斜的角度,为0时赤道正对着我们,角度为正时,地球向南倾斜
%旋转;
disp(‘请输入您的操作按Enter键结束:‘);
ope=input(‘‘‘s‘);
if ope==‘move‘
disp(‘地球正在旋转...‘);
disp(‘请按Ctrl+C键退出‘);
while 1
for i=1:1800
j=m+i*0.2;
if(j>360)
j=j-360;
end
view(jn);
pause(0.01);
end
end
end
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 312728 2012-03-15 19:08 earth\earth.jpg
文件 2180 2012-04-14 12:35 earth\earth.m
文件 1398329 2008-09-03 16:20 earth\globe.jpg
文件 972434 2012-03-15 19:28 earth\moon.jpg
文件 1311 2012-04-14 12:50 earth\satellite.m
目录 0 2012-05-06 16:38 earth
----------- --------- ---------- ----- ----
2686982 6
相关资源
- Pattern Recognition and Machine Learning(高清
- MATLAB 编程 第二版 Stephen J. Chapman 著
- 均值滤波和FFT频谱分析Matlab代码
- 《MATLAB扩展编程》代码
- HDB3码、AMI码的MATLAB实现
- 3点GPS定位MATLAB仿真
- MATLAB数字信号处理85个实用案例精讲入
- matlab从入门到精通pdf94795
- 欧拉放大论文及matlab代码
- 跳一跳辅助_matlab版本
- 全面详解LTE MATLAB建模、仿真与实现
- MIMO-OFDM无线通信技术及MATLAB实现_孙锴
- MATLAB Programming for Engineers 4th - Chapman
- matlab 各种谱分析对比
- 分数阶chen混沌matlab程序
- 基于粒子群算法的非合作博弈的matl
- MATLAB车流仿真 包括跟驰、延误
- matlab空间桁架计算程序
- 基于MATLAB的图像特征点匹配和筛选
- DMA-TVP-FAVAR
- GPS信号的码捕获matlab代码.7z
- 一维光子晶体MATLAB仿真代码吸收率折
- newmark法源程序
- 传统关联成像、计算鬼成像matlab
- pri传统分选算法
- 摆动滚子推杆盘形凸轮设计
- 医学图像重建作业matlab源码
- Matlab实现混沌系统的控制
- 检测疲劳驾驶
- Matlab锁相环仿真-Phase Locked Loop.rar
评论
共有 条评论