mohitsgw / earth-api-samples

Automatically exported from code.google.com/p/earth-api-samples
0 stars 0 forks source link

Problem with a transition from 0.1 to 359.9 degrees, <heading> only animated clockwise around the positive Z-axis #654

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hello,

my name is Michael Graf. Actually I’m working on my bachelor thesis. The main 
task is to visualize flight-data using an animation. I decided to realize this 
animation by using the Google-Earth-plug-in. I have an aircraft model embedded 
in a <Placemark>. The model is located in a .dae-file. I‘ve changed the 
<Location>and <Orientation> with an <AnimatedUpdate> during a 
<Tour>.Unfortunately I’ve discovered a bug in my animation at the orientation 
of the aircraft model. E.g. the <heading> changes from 0.1 to 359.9, the model 
revolves completely around its own axis, because <heading> animated clockwise 
around the positive Z-axis. In my expectation the animation has to recognize 
the shortest way and turn around counter-clockwise.

How can I solve this problem? 

Above all, why does the transition of <Camera> work correctly? In this case 
<heading> recognizes that the way from 0.1 to 359.9 counter-clockwise is 
shorter and makes only a small correction of the angle.
Here is my code:

The aircraft model:

<Placemark>

<name>Model</name>

            <Style id="default"></Style>

            <Model id="plane">

                        <altitudeMode>absolute</altitudeMode>

                        <Location id="planeLocation">

                                   <longitude>8.562517</longitude>

                                   <latitude>50.039353</latitude>

                                   <altitude>0</altitude>

                        </Location>

                        <Orientation id="planeOrientation">

                                   <heading>70</heading>

                                   <tilt>0</tilt>

                                   <roll>0</roll>

                        </Orientation>

                        <Scale id="planeScale">

                                   <x>1</x>

                                   <y>1</y>

                                   <z>1</z>

                        </Scale>

                        <Link>

                                   <href> plane.dae</href>

                        </Link>

                        <ResourceMap></ResourceMap>

            </Model>

</Placemark>

The AnimatedUpdate:

<gx:AnimatedUpdate>

            <gx:duration>0</gx:duration>

            <Update>

                        <targetHref></targetHref>

                        <Change>

                                    <Location targetId="planeLocation">

<longitude>8.5261605143703</longitude>

                                               <latitude>50.0065632513577</latitude>

                                               <altitude>243.14334</altitude>

                                   </Location>

                                   <Orientation targetId="planeOrientation">

                                               <heading>0.1</heading>

                                               <tilt>0</tilt>

                                               <roll>0</roll>

                                   </Orientation>

                                   <Scale targetId="planeScale">

                                               <x>1</x>

                                               <y>1</y>

                                               <z>1</z>

                                   </Scale>

                        </Change>

            </Update>

</gx:AnimatedUpdate>

<gx:AnimatedUpdate>

            <gx:duration>2</gx:duration>

            <Update>

                        <targetHref></targetHref>

                        <Change>

                                   <Location targetId="planeLocation">

                                               <longitude>8.52615529417278</longitude>

                                               <latitude>50.0035879821659</latitude>

                                               <altitude>296.25082</altitude>

                                   </Location>

                                   <Orientation targetId="planeOrientation">

                                               <heading>359.9</heading>

                                               <tilt>0</tilt>

                                               <roll>0</roll>

                                   </Orientation>

                                   <Scale targetId="planeScale">

                                               <x>1</x>

                                               <y>1</y>

                                               <z>1</z>

                                   </Scale>

                        </Change>

            </Update>

</gx:AnimatedUpdate>

<gx:Wait>

            <gx:duration>2</gx:duration>

</gx:Wait>

Thank you in anticipation,

Michael

Original issue reported on code.google.com by michael....@innovapps.de on 14 Jul 2011 at 2:47

GoogleCodeExporter commented 8 years ago
I have the same exact issue with my airborne animation.  This must be a bug 
with GE.  Hopefully it is fixed soon.

Original comment by Robert.m...@gmail.com on 12 Sep 2011 at 5:53