How to simply create a sphere in KML ???

2,148 views
Skip to first unread message

fightmeyer

unread,
Dec 12, 2006, 2:02:28 AM12/12/06
to KML Discussions
Hi!

Is there a simple way to create a sphere in GE/KML ?
Something like:

<sphere>
<centre> x,y</centre>
<radius>20</radius>
</sphere>

or something similar?

Thanx in advance.

Fightmeyer

barryhunter

unread,
Dec 12, 2006, 8:51:55 AM12/12/06
to KML Discussions
I don't think so (not sure there's even circles yet), but it is something that should be very easy to create in Google Sketchup. Once you have a model you can then manipulate and move it around the Google Earth with KML as though it was a primitive object.

ink_polaroid

unread,
Dec 13, 2006, 3:42:29 AM12/13/06
to KML Discussions
As Barry says, drawing your sphere with Google Sketchup is the way to go. You'll be done in two minutes.

But if you want to go old skool, some idiot cooked up this thing way back when: http://dev.bt23.org/keyhole/spheregen/

fightmeyer

unread,
Jan 4, 2007, 10:10:18 AM1/4/07
to KML Discussions
Can someone create me an example please?
I don't get along with scetchup. It's easy to create a sphere, but i don't know, how to show it in GE and change it's size and position.
Maybe someone is able to create a model and an KML with 2 of these spheres in different size and position, so i can figure out how the parameters work.

Thx in advance.
Fightmeyer

ink_polaroid

unread,
Jan 5, 2007, 1:11:39 AM1/5/07
to KML Discussions

Daniel_Denk

unread,
Jan 5, 2007, 4:15:32 AM1/5/07
to KML Discussions

fightmeyer

unread,
Jan 5, 2007, 5:47:04 AM1/5/07
to KML Discussions
Thnxs a lot. I exported it to GE and it works.
But now I started to manipulate the heigth of the Object and its scale (x,y,z)
But this does not only resize the Model, it also moves the model to another position. How can this be?

Daniel_Denk

unread,
Jan 5, 2007, 3:51:58 PM1/5/07
to KML Discussions
What are the tags you're using? More info generally aids anyone to help with a possible answer.

ManoM

unread,
Jan 5, 2007, 4:39:35 PM1/5/07
to KML Discussions
Hi fightmeyer,

Can you post all your code so we can debug it? A KMZ file with the model is the most helpful.

Thanks,
ManoM

fightmeyer

unread,
Jan 8, 2007, 3:23:38 AM1/8/07
to KML Discussions
Sorry.
I've created a zip-File with an example. You can download it here:

http://rapidshare.com/files/10756821/sphere.zip.html (scroll down an cklick on "free"; then enter the security Code at "hier eingeben")

It's a zip file. Please, don't use it as a kmz file. Unpack it. There are three kml-files in it.

doc_original.kml (puts a sphere directly on the ground)

Code:

<?xml version='1.0' encoding='UTF-8'?>
<kml xmlns='http://earth.google.com/kml/2.1'>
<Placemark> <name>sphere_tutorial_1_</name>
<description><!CDATA[Created with <a href="http://sketchup.google.com">Google SketchUp</a>]]></description>
<DocumentSource>SketchUp</DocumentSource>
<Style id='default'>
</Style>
<Model>
<altitudeMode>relativeToGround</altitudeMode>
<Location>
<longitude>-105.283000000000</longitude>
<latitude>40.017000000000</latitude>
<altitude>0.000000000000</altitude>
</Location>
<Orientation>
<heading>0</heading>
<tilt>0</tilt>
<roll>0</roll>
</Orientation>
<Scale>
<x>1.0</x>
<y>1.0</y>
<z>1.0</z>
</Scale>
<Link>
<href>models/sphere_tutorial_1_.dae</href>
</Link>
</Model>
</Placemark>
</kml>




doc_hover.kml (puts a sphere about 10 meters over the ground; works fine)

Code:

<?xml version='1.0' encoding='UTF-8'?>
<kml xmlns='http://earth.google.com/kml/2.1'>
<Placemark> <name>sphere_tutorial_1_</name>
<description><!CDATA[Created with <a href="http://sketchup.google.com">Google SketchUp</a>]]></description>
<DocumentSource>SketchUp</DocumentSource>
<Style id='default'>
</Style>
<Model>
<altitudeMode>relativeToGround</altitudeMode>
<Location>
<longitude>-105.283000000000</longitude>
<latitude>40.017000000000</latitude>
<altitude>10.000000000000</altitude>
</Location>
<Orientation>
<heading>0</heading>
<tilt>0</tilt>
<roll>0</roll>
</Orientation>
<Scale>
<x>1.0</x>
<y>1.0</y>
<z>1.0</z>
</Scale>
<Link>
<href>models/sphere_tutorial_1_.dae</href>
</Link>
</Model>
</Placemark>
</kml>



doc_hover_and_scale (puts a sphere 10 meters over ground an scales it up, so it ist twice as big as normal; doesn't work proper; moves the sphere about 30 Meters to north and if you zoom in, the sphere seems to disappear)

Code:

<?xml version='1.0' encoding='UTF-8'?>
<kml xmlns='http://earth.google.com/kml/2.1'>
<Placemark> <name>sphere_tutorial_1_</name>
<description><!CDATA[Created with <a href="http://sketchup.google.com">Google SketchUp</a>]]></description>
<DocumentSource>SketchUp</DocumentSource>
<Style id='default'>
</Style>
<Model>
<altitudeMode>relativeToGround</altitudeMode>
<Location>
<longitude>-105.283000000000</longitude>
<latitude>40.017000000000</latitude>
<altitude>10.000000000000</altitude>
</Location>
<Orientation>
<heading>0</heading>
<tilt>0</tilt>
<roll>0</roll>
</Orientation>
<Scale>
<x>2.0</x>
<y>2.0</y>
<z>2.0</z>
</Scale>
<Link>
<href>models/sphere_tutorial_1_.dae</href>
</Link>
</Model>
</Placemark>
</kml>



Anyone an idea? What am i doing wrong?

fightmeyer

unread,
Jan 8, 2007, 8:16:02 AM1/8/07
to KML Discussions
I think i found the answer. The sphere within the KMZ-File wasnt exactly positioned at 0,0,0 in ScetchUp. That caused this moving effect, when scaling the sphere up. I created a new one with the center exactly at 0,0,0 and now it works.
By the way. Which unit uses scetchup? I want to make a sphere with a radius of exactly 0.5 meters but i only get Inches or something shown in the bottombar.
Reply all
Reply to author
Forward
0 new messages