Google Earth add-ons and visualizations. KML, SketchUp and more.

Main menu:

 Posts(RSS)

Popular

Site search

Archive

Google Earth Skydome Using PhotoOverlay

Sky in Google Earth using PhotoOverlayA few months ago I posted a Google Earth add-on which used a large 3D model hemisphere with a full-sky cloud image plastered on the inside to create fake sky backdrops.  Turns out, with a little bit of KML magic you can do pretty much the same thing with the new panoramic Photo Overlay feature in Google Earth 4.2.

This is a PhotoOverlay sky centred on the Swiss Alps:

PhotoOverlay Skydome (30kB)  

Opening the file takes you straight inside the panorama. When you click ‘exit photo’ the dome remains visible, enabling you to fly around the inside the same way as the 3D model version.  If you move too far away from the dome it disappears, replaced by an Icon. Double click on this Icon or the label under the ‘Places’ panel to re-enter it.

Compared with my 3D model version this has the advantage of being very quick to put together from scratch. The key is to use a very large spherical Photo Overlay, with a field of view covering just the top half and Camera altitude set at, or very near ground level. Here’s the KML stripped to its basics:

<?xml version=”1.0″ encoding=”UTF-8″?>
<kml xmlns=”http://earth.google.com/kml/2.2″>
<PhotoOverlay>
  <Camera>
     <longitude>8.230</longitude>
     <latitude>46.707</latitude>
     <altitude>100</altitude>
     <heading>0</heading>
     <tilt>90</tilt>
     <roll>0</roll>   
  </Camera>
  <Icon>
  <href>files/clouds.jpg</href>
  </Icon>
  <ViewVolume>
   <leftFov>-180</leftFov>
   <rightFov>180</rightFov>
   <bottomFov>0</bottomFov>
   <topFov>90</topFov>
   <near>20000</near>
  </ViewVolume>
  <Point>
   <altitudeMode>relativetoGround</altitudeMode>
   <coordinates>8.230, 46.707, 0</coordinates>
  </Point>
  <shape>sphere</shape>
  <roll>0</roll>
</PhotoOverlay>
</kml>

  • The <ViewVolume> attributes tell GE what proportion of the sphere to display.  A complete sphere would have a <bottomFov> value of -90.  Here I just want the top half so I set this to 0.
  • The radius of the sky dome is given by the <near> value.   20,000 metres in this case.  Note, if this value is too large, GE won’t fully render it.
  • On mountainous terrain the <Camera> altitude is tricky to get right.  Too low and GE finds it impossible to fly inside to view the panorama in photo-mode. Too high and there’s a visible gap between dome and the ground.
  • The <Point> coordinates aren’t absolutely necessary, but do ensure there’s an Icon when the dome itself isn’t visible, which is useful. 

For the image you need a 360 degree panoramic cloud photo.  The one in this file is an equirectangular image (sky12.jpg) from Philo’s Sky Collection. I chopped off the bottom half of the original and reduced it 1024 pixels wide.  High resolution images would need splitting into smaller tiles and the creation of an <ImagePyramid>. For further info check out the new KML topics documentation here: http://code.google.com/apis/kml/documentation/topicsinkml.html

Comments

Comment from Frank Taylor
Time: September 24, 2007, 11:36 am

Hmm….I’m not liking this approach as much as your previous approach at sky domes. Even if it is easier to set up. The Photo Overlay approach uses a low resolution version of the texture when you are not in the photo-viewer. So, when I fly around inside it, I can easily see pixelization.

Comment from James
Time: September 24, 2007, 12:45 pm

Yes, it’s especially noticeable when you roll the view in flight-mode. I guess partly down to lack of anti-aliasing.

However, I do like the greater control in the photo-viewer - useful for pivoting around a single point if you don’t have a Space Navigator.

Write a comment