ink_polaroid
Sysop
Reged: 01/01/05
Posts: 1868
Loc: SF Bay Area, CA
|
|
One of the most exciting features of Google Earth is the ability to draw polygons and extrude them to form three-dimensional shapes.
The drawing tools in the client are great for such things as marking boundaries and creating simple buildings, but almost as soon as we released Google Earth, many of you noticed that by editing or creating your own KML, much more complex shapes could be created. (A couple of the first examples that really impressed us were King Kong (complete with bi-plane!) and Stonehenge.)
We think this is going to be a very popular feature, so we have created this forum for you to share your creations.
To get you started, we have posted a few examples of what's possible. These models were authored externally, and the data converted to KML.
(This process is obviously more complex than simply clicking around in Google Earth, but it's not as difficult as you might think. Indeed, we're working on a few tools that will help make the process significantly easier. Stay tuned to this channel for updates.)
If you would like to get started on your own creations, we can suggest a few simple steps to get you started. But before we start, open the this post's attachment in Google Earth.
- Use the polygon tool in Google Earth Plus (or Pro) to create a simple shape. For example, draw an outline around a famous area in your favourite city. If you examine the "base" polygon in the attachment, you can see that I drew an outline of San Francisco's Union Square.
- Once you have created your polygon, highlight it in your Places window, right-click and copy it.
- Open a text editor (Notepad is fine) and select paste to see the code for your shape. (Or you can save your shape as a KML file and open that in a text editor.)
- Now comes the tricky part. If you study the code, you can see how Google Earth renders its shapes. For a 4-sided flat shape, there will be five points. Notice that the coordinates for the first and last point are the same. This is because Google Earth draws lines from point 1 to point 2, pt 2 to pt 3, pt 3 to pt 4, and from pt 4 back to the start. (In general, for an N-sided shape, you will need to generate N+1 coordinate points.) Try a copy/paste with the base polygon to see what we mean.
- Just as it is possible to create a vertical "wall" by drawing a path and extruding it, it is also possible to do this by using the above principle to place the coordinates in the correct place. Take a look at the "west wall" poly. If you examine the code, it should be obvious that this wasn't created with Google Earth.
- Now take a look at the "west roof" poly. This wasn't created in GE, nor can it be. To do this, the north-west and south-west points were taken from the base poly (with appropriate heights), and mid-points (with new altitudes) were calculated to form the sloping roof.
We leave it as an exercise for the interested reader to generate the other walls and the other half of the roof. You should need nothing more than a pencil, some paper, basic math skills, a little patience and a calculator. (Or, yes, you can cheat and use a spreadsheet. )
One final note: it's obvious that I didn't create the Golden Gate Bridge in this way. We are working on something that will help you to generate some very impressive KML models, but until we have it ready, here's a quick tip for those of you with some CAD experience: the trick is to generate an output of the model's vertices that are in the correct winding order. (That is, face X has verts 1, 2, 3, face Y has verts 4, 5, 6 ... etc.) If you can do that, you're half-way there.
|
|