View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# How to draw a earth

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

6 replies to this topic

### #1icuit  Members

Posted 12 July 2011 - 09:52 PM

Hi, guys!

I want to draw a earth as to overlay some interest on it .
but you know that the earth is spheroid andsemi-major axis is longer than the other.

anybody who give some ideas? 3ks here.

### #2Argo1516  Members

Posted 13 July 2011 - 02:17 AM

So kinda like this?
http://learningwebgl.com/blog/?p=1778

basically a sphere with a texture of earth sphere-mapped to it.

Your post is hard to decipher.

### #3Aks9  Members

Posted 13 July 2011 - 03:48 AM

The Earth is a planet, not a spheroid. Its precise mathematical model is rather complex.
For the most precise approximation of the mean sea level you should use geoid. The geoid is changing. It depends on the magnetic field of the Earth, but also depends on the Sun and the Moon. You can download some pretty precise geoid models of the Earth.

Less precise, but more common is the approximation that uses ellipsoid. WGS84 ellipsoid is used for GPS navigation and is very common these days.

The least accurate approximation of Earth curvature is a sphere. I have no idea what your visualization would serve for, but in 99.99% you will not see the difference between the shpere and WGS84 ellipsoid. You have noticed that there are differences between axis, but that difference is only 0.3%!!! The difference can be noticeable only when placing satellites high above the Earth, since calculated geographic position of the point beneath would significantly depend on the chosen approximation.

Also you would need same DEM data. For precise modeling you need several terabytes of data (both textures and DEM).

If the overlay is in a specific projection, you'll also need assistance of some GIS tool, or reprojecting library.

### #4samoth  Members

Posted 13 July 2011 - 05:14 AM

@Aks9: Kudos for pointing out WGS84.

Though I really believe that it's entirely impossible for any of us to see a difference between a sphere and WGS84 in this situation. At 26'' screen resolution, a fullscreen earth would have a difference of 4 pixels between horizontal and vertical diameters. I'm pretty sure that even if shown both images side by side, I would be unable to tell one from the other. And in a "placebo controlled" experiment, I would probably be wrong 50% of the time :-)

### #5icuit  Members

Posted 17 July 2011 - 08:25 PM

The Earth is a planet, not a spheroid. Its precise mathematical model is rather complex.
For the most precise approximation of the mean sea level you should use geoid. The geoid is changing. It depends on the magnetic field of the Earth, but also depends on the Sun and the Moon. You can download some pretty precise geoid models of the Earth.

Less precise, but more common is the approximation that uses ellipsoid. WGS84 ellipsoid is used for GPS navigation and is very common these days.

The least accurate approximation of Earth curvature is a sphere. I have no idea what your visualization would serve for, but in 99.99% you will not see the difference between the shpere and WGS84 ellipsoid. You have noticed that there are differences between axis, but that difference is only 0.3%!!! The difference can be noticeable only when placing satellites high above the Earth, since calculated geographic position of the point beneath would significantly depend on the chosen approximation.

Also you would need same DEM data. For precise modeling you need several terabytes of data (both textures and DEM).

If the overlay is in a specific projection, you'll also need assistance of some GIS tool, or reprojecting library.

I think I need a precise mathematical model to the earth, because I am a gis programmer. I can expertly use professional gis tool, but lack of 3d knowledge.
At first I want to model the earth reference to google earth or worldwind earth.
the most precise approximation of the mean sea level is changing at any time, that's exactly rather complex for me.
I preliminary plan to use ellipsoid and refer to WGS84, as it is commonly and widely used in the world. we can cplit the earth by longitude and latitude.
In WGS84,the parameters described as the semi-major axis is 6378137.0,and the slope is 298.257223563.

I bought the 《opengl super bible》forth editon.In the book,it uses the glut libs. but i do not find a api to draw a ellipsoid.
could you give more advices? thanks.

### #6rdragon1  Members

Posted 17 July 2011 - 11:15 PM

You can only draw triangles. So take your math model and turn it into triangles - probably thousands of them

### #7MarekKnows.com  Members

Posted 20 July 2011 - 10:59 AM

in the physics section on my website you will find a video tutorial that shows how you can render a planet

---
Free C++, OpenGL, and Game Development Video Tutorials @
www.MarekKnows.com
Play my free games: Ghost Toast, Zing, Jewel Thief

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.