Strange Model behaviour

6 views
Skip to first unread message

Nymor

unread,
Dec 11, 2009, 11:51:26 PM12/11/09
to KML Developer Support - Google Earth Plug-in
Hi,

I noticed something a while ago but thought it was just a temporary
glitch ... but it now seems to be a permanent fixture and is quite
odd.

I have a number of kmz files that have a couple of models in each. The
Models reference hosted .dae files and are clamped to the ground.
However in certain circumstances they float some distance above the
ground (around 30m).

This can be seen by following the link below:-
http://www.racemyrace.com/race.php?rid=8

This link opens my app and loads a specific race (in this case the
Birkie 50k) and after a couple of seconds takes the view to the a
position looking at the Start Gate. That seems to be fine and the
Model looks as it should.

If you now click on the Globe button below the Clock (1st button in
that set of 3) the View is moved to above to take in the whole course.
From there if you zoom back in on the Start the model now appears to
be floating in mid air and not on the ground as it was.

(All the Globe button does is to change the view point so when the
simulator runs the view doesn't follow the racers as it does with the
other 2).

There's nothing remarkable about the kml for the Models Placemark:-

<Placemark>
<name>Start Gate</name>
<description>Start Gate</description>
<Model>
<altitudeMode>clampToGround</altitudeMode>
<Location>
<longitude>-91.2511728634334</longitude>
<latitude>46.1951812019232</latitude>
<altitude>0</altitude>
</Location>
<Orientation>
<heading>267.103685411578</heading>
<tilt>0</tilt>
<roll>0</roll>
</Orientation>
<Scale>
<x>1</x>
<y>1</y>
<z>1</z>
</Scale>
<Link>
<href>http://RaceMyRace.com/player/data/models/
start_01.dae</href>
</Link>
</Model>
</Placemark>

and it seems fine in the Standalone GE app.

The "floating" happens in both FF3 & IE6 on Win2000 and FF3 & IE8 on
XP.

Any idea what might be causing this odd behaviour??

Thanks
Nymor

Nymor

unread,
Dec 12, 2009, 12:10:54 PM12/12/09
to KML Developer Support - Google Earth Plug-in
Well (fingers crossed) I might have found a solution - although it
does look like a bug of some kind.

When I switch to the FreeView (clicking the Globe button) I do 3
things:-

1. Set the Camera
2. Turn off some Screen Overlays
3. Show the Nav Controls.

On my test system I tried changing the order of these (no change) and
then removing each of them. When I removed the 'Set the Camera' the
Models worked as they should.

Now I need to set the View when I click that button so I tried
wrapping that bit in a timeout (no change).

I then tried using a LookAt instead of a Camera. I was orginally using
a Camera because it provides more flexibilty and I used to capture the
Camera's position relative to the Racer placemarks but I've since
changed it just to record where the view was the last time it was used
so can use a LookAt in this case now.

So it seems if I set the View using Camera the Models' positions go
funny but if I use a LookAt instead they stay fixed to the ground as
they should.

Very strange but, for now at least, this workaround seems to do the
job.

(If anyone has any idea why this should be the case - or whether this
is a bug - I'd still be interested as I may wish to return to the
Camera for that particlar view in the future. It doesn't make much
sense to me that the use of Cam or LA should have any effect on any
Models that are included?).

Regards
Nymor
Reply all
Reply to author
Forward
0 new messages