Account Options

  1. Sign in
Google Groups Home
« Groups Home
Discussions > Google Earth Plug-in > Real-Time Tour Simulator
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Nymor  
View profile  
 More options Jan 5 2009, 1:23 am
From: Nymor
Date: Sun, 4 Jan 2009 22:23:58 -0800 (PST)
Local: Mon, Jan 5 2009 1:23 am
Subject: Real-Time Tour Simulator
Hi,

I have a Formula 1 collection in the Sports (moderated) section of the
GE Community boards for last year. One of it's features was a Flying
Lap of each of the circuits which unfortunately doesn't work as
designed any more as you can't set the Tour range to <150m any more in
GE 4.3.

Because of that I looked towards the Plugin to give me back that
functionality - and improve upon it. Rather than just make it specific
to what I needed I decided first to make it fairly generic as Touring
linestrings seemed to be a popular requirement and one which has been
discussed many times in this group and the solution I have may be of
use to others.

I do have a few bugs to iron out, which I'll touch on towards the end
of this post, and also a fair bit of tidying up to do - but in the
meantime let me outline the approach I have taken.

http://www.thekmz.co.uk//GEPlugin/pathtour/v1/path_tour_v1.htm
(beware ... it's quite busy as it's really a test platform but all
will become clear ;) )

(Those familiar with Roman's Driving Simulator will recognise alot of
the structure although there are some fundamental diffences in how it
works).

My Linestring KML contains only a linestring - the example being of
Silverstone (home of the British Grand Prix)

There is then an option to tour at a fixed speed. This is the speed
with which you actually cover the ground. There is a routine that
adjusts the timing on each TICK to ensure this is the case and the
speed displayed at the foot of the form is the actual speed you are
travelling.

In the example however I have added the speed for each segment by
using the Altitude part of the Coordinates. If the speed on the form
is set to 0 the code will use the Altitude (in m/s) as it's speed.
This was, imo, a good use of a spare slot but when I add g-force and
gears in I will have to use a different method. (You can open the KML
in GE and set it to Extrude relative to ground to see a speed map of
the circuit).

The Model KMZ is a Ferrari with The Stig at the wheel.

You then Initialise the lap. It doesn't do OnLoad so you can load your
own linestring and/or model.

Bugette 1: When you initialise and Alert comes up says the KML has
loaded. I wish I didn't have to do that but if I don't it it tries to
parse the KML before it's finished loading. Help to sort that would be
appreciated.

Once initialised you should then be sitting on the start line ready to
go. Again sometimes, if the Plugin is being a bit slow it doesn't
always get there. Hit init again if that's the case.

You can then Start the tour.

Note: If the first and last coords in the linestring are the same (as
it is in the example) the tour will loop continuously.

By default the LookAt follows the linestring and you can change the
Altitude, Range, Tilt, and Rotation as the Tour is running. (These are
OnClick not Mousedown/up so you have click multi-times).

You can change to the Camera as well but remember that the 4 values
mean slightly different things when applied to a camera. (Altitude of
at least +1 is best here).

Camera is something I'm going to work on some more as it also has Roll
which I have added in another test file and works really well with a
motorbike as the whole scene, and bike, rolls as you go into a
corner :)

You can hide the Linestring or Model and also toggle the terrain. When
the Range is really small I turn the terrain off as the model jumps up/
down too much - another thing I'd like to fix somehow.

Within the code I've added just about everything to the TourSimulator
object as a want to be able to have more than one linestring/model
running at the same time and the only thing common to them all would
be the SpeedFactor than increases/decreases the speed of the whole
set.

Now for some other bugs....

If I zoom-in (Range) to around ~<=6m and then pause the sim not only
pauses but the view alters as well. This doesn't happen at larger
ranges and becomes even more pronounced at lower ones. How do I stop
this happening? My first thought is that it is something to do with
the Tilt-on-Zoom thing but am not sure.

If I'm close the sim seems very smooth but if I zoom out to a 100m say
it seems a bit jerky. With each TICK I change the heading and speed as
a % of the segment distance and have tried it with a fixed speed and
also without the speedAdjustment (the part that adjusts to real-time)
but get the same results. I happy-ish as it is as I intend to run it
from an in-car prospective but would dearly love it to be as smooth as
the Milktruck.

For info - my linestring was created using Bezier Splines which is how
I got it how it is ... allowing me to get the car to follow an exact
path with a smooth curve.

Anyway thanks for reading - comments welcome

Regards
Nymor

(PS I hope you all had a great New Year and have an even better 2009.
It's the job market for me :? )


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Markw65  
View profile  
 More options Jan 5 2009, 2:46 pm
From: Markw65
Date: Mon, 5 Jan 2009 11:46:25 -0800 (PST)
Local: Mon, Jan 5 2009 2:46 pm
Subject: Re: Real-Time Tour Simulator

On Jan 4, 10:23 pm, Nymor wrote:

> Bugette 1: When you initialise and Alert comes up says the KML has
> loaded. I wish I didn't have to do that but if I don't it it tries to
> parse the KML before it's finished loading. Help to sort that would be
> appreciated.

Well, you're not using the callback (properly).

Your LoadKml completes immediately, and then drops through to the rest
of the code - which fails (absent the "alert") because the kml hasnt
loaded yet.

Some time later, your finishLoadKml function executes. But thats too
late.

The "correct" way to use the callback would be something like
(untested):

function finishLoadKml(kmlObject) {
   // check if the KML was fetched properly
   if (kmlObject) {
                currentKmlObject = kmlObject;
                if (chkbox_linestringVisibility.checked) ge.getFeatures().appendChild
(currentKmlObject);
                obj_linestring_placemark = currentKmlObject;
                var la = ge.createLookAt('');

/* this code moved here from InitializeTour */
        var init_options = [];
        init_options.kmlModelUrl = kmlModelUrlBox.value;
        init_options.speed = SpeedBox.value - 0;
        init_options.range = AltitudeBox.value - 0;
        init_options.range = RangeBox.value - 0;
        init_options.tilt = TiltBox.value - 0;
        init_options.rotation = RotationBox.value - 0;

        init_pathtour(obj_linestring_placemark, init_options);

        } else {
     alert('Bad KML');
   }
 }

function InitialiseTour() {
        if (t_simulator) {
                t_simulator.destroy();
                clear_features();
        }

        kmlPathUrl = kmlPathUrlBox.value;
        //kmlModelUrl = kmlModelUrlBox.value;

        LoadKml(kmlPathUrl);

       /* rest of the code moved into finishLoadKml, because it
          hasnt finished loading until that executes */


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tanguy  
View profile  
 More options Jan 5 2009, 6:40 pm
From: Tanguy
Date: Mon, 5 Jan 2009 15:40:09 -0800 (PST)
Local: Mon, Jan 5 2009 6:40 pm
Subject: Re: Real-Time Tour Simulator
 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nymor  
View profile  
 More options Feb 6 2009, 12:25 am
From: Nymor
Date: Thu, 5 Feb 2009 21:25:23 -0800 (PST)
Local: Fri, Feb 6 2009 12:25 am
Subject: Re: Real-Time Tour Simulator
Hi,

Very remiss (and rude) of me not to reply before now - apologies for
that.

@Markw65
Thanks for that. It's an error I've made before, and I'm sure I will
again although I'll try not to. Made the changes you suggested and can
now get rid of the alert message. I decided to go further and remove
the whole Initialise step and incorporate it all in the page load.
(The Linestring and Model can still be changed but now have to be done
within the Set_Defaults function as I wanted to make the next version
less generic and simplify it a bit).

@Tanguy
Thanks for the ideas :)
I tried the Speedo Gauge but found that unless I set it to update
every 1second, say, rather than every tick it really slowed everything
down. Looked at using the Bindows gauges instead which looked
promising to begin with as they only redraw the arrow rather than the
whole control but I gather they don't work on Safari and I didn't want
to restrict myself at this stage.
Still looking though - but for now I'll just leave the speedo as a
text field - open to suggestions though.

I've found some time to play around a bit more and have added a
circuit overview in a map div and tidied things up a bit. The latest
copy can be found at

http://www.thekmz.co.uk/GEPlugin/pathtour/v3/path_tour_v3.htm

Some issues still remain however which I'd like to sort out if anyone
can point me in the right direction.

The main one is the issue of what happens if when you're really close
to the car and Pause the tour. This is especially apparent when using
LookAt.

If I'm running the tour and zoom in to between 4 or 5 metres, say, and
then Pause the view changes to be looking down on the car. If I then
restart it goes back to where it was. Don't know what's causing this
but any assistance would be greatly appreciated - I promise to
acknowledge replies in a more timely fashion this time ;)

Thanks in advance

Regards
Nymor


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »