gpt4 book ai didi

kml - 使用 kml 在 Google Earth 中动画一条线

转载 作者:行者123 更新时间:2023-12-04 16:47:32 26 4
gpt4 key购买 nike

我非常擅长使用 animated update谷歌地球的功能,我用它来移动models大约。我真正想做的是能够为 line 制作动画(例如向上和向下)在 Google 地球中,但我发现这很棘手。

我一开始就有这条线的经度和纬度。例如线坐标是:

-88,17,100 -88.20270841086835,17.21899813162266,100



然后我想 raise这条线的一端在 5 秒内到达海拔 500 度。

我已经使用 LineString 画了线:
<Placemark id="path1">
<name>Untitled Path man</name>
<LineString>
<tessellate>1</tessellate>
<coordinates>
-88.,17,100 -88.20270841086835,17.21899813162266,100
</coordinates>
</LineString>
</Placemark>

但我现在不知道如何使用 <gx:AnimatedUpdate>将一个结束从 100 移动到 500。

我确定这很容易 - 有人可以指出我正确的方向吗??

最佳答案

诀窍是更新 LineString 元素(带有 id)而不是地标。

这是一个有效的 KML 示例导览,它为从 100 到 500m 的相对高度变化的线设置动画。

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2">
<Document>
<name>gx:AnimatedUpdate example</name>
<open>1</open>

<LookAt>
<longitude>-88.1351880996469</longitude>
<latitude>17.09943637744042</latitude>
<altitude>0</altitude>
<heading>49.91874373078863</heading>
<tilt>84.43764019949967</tilt>
<range>1929.311316966288</range>
<gx:altitudeMode>relativeToSeaFloor</gx:altitudeMode>
</LookAt>

<Placemark>
<name>Untitled Path man</name>
<LineString id="path1">
<tessellate>1</tessellate>
<altitudeMode>relativeToGround</altitudeMode>
<coordinates>
-88,17,100 -88.20270841086835,17.21899813162266,100
</coordinates>
</LineString>
</Placemark>

<gx:Tour>
<name>Play me!</name>
<gx:Playlist>
<gx:AnimatedUpdate>
<gx:duration>5</gx:duration>
<Update>
<targetHref/> <!-- Left empty to refer to the current file -->
<Change>
<LineString targetId="path1">
<coordinates>
-88,17,100 -88.20270841086835,17.21899813162266,500
</coordinates>
</LineString>
</Change>
</Update>
</gx:AnimatedUpdate>

<!-- Wait for the animation to complete (see the touring
tutorial for an explanation of how AnimatedUpdate's
duration isn't enough to guarantee this). -->
<gx:Wait>
<gx:duration>5.0</gx:duration>
</gx:Wait>
</gx:Playlist>
</gx:Tour>
</Document>
</kml>

详情见 https://developers.google.com/kml/documentation/touring#tourtimelines

关于kml - 使用 kml 在 Google Earth 中动画一条线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13418779/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com