How to plot 3D Earth in Python?
Asked Answered
B

1

10

I'm trying to plot a satellite orbit around the Earth. This is what I currrently have:

enter image description here

I made this plot using the Axes3D function in mpl_toolkits.mplot3d. Ideally what I would like to do, is to replace the simple sphere with an actual Earth with topology.

If you're not sure what I mean, take a look at a MATLAB implementation:

http://uk.mathworks.com/matlabcentral/fileexchange/13823-3d-earth-example

The Basemap package could be of help (especially the bluemarble() function), but unforunately I can't make it work on 3D objects. There is a similar question here, but the answer to that question results in a projection of a 3D sphere on a 2D plot. I want a 3D sphere on a 3D plot, so that I'm able to rotate around it.

Does anybody know of another package/implementation. Or is there a way to make Basemap work with 3D objects?

---EDIT---

Somebody asked the same question, but nobody has answered it yet

Boyar answered 17/1, 2016 at 12:51 Comment(2)
Possible duplicate of Plotting cylindrical map data over a 3D sphere in PythonDoloresdolorimetry
not a duplicate... the answer to that question results in a projection of a 3D sphere on a 2D plot. I want a 3D sphere on a 3D plot, so that I'm able to rotate around itBoyar
M
2

I have asked something similar some times ago

PyOpenGL sphere with texture

If I were you I would pick a OpenGL and use a texture of Earth on it just like this one

enter image description here https://i.sstatic.net/ojwD8.jpg

In any case there is my second thread where I needed to make a Mars planet which is basically the same as you want except different texture:

Why my texture is not showing PyOpenGL

Mahmud answered 31/5, 2017 at 10:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.