Virtual Earth 3D Flight Simulator

Update: Chck out Version 1.1 of this flight simulator here:http://rbrundritt.spaces.live.com/blog/cns!E7DBA9A4BFD458C5!773.entry

The Virtual Earth 3D control is a great tool when you not only want to know where some place is in the world, but also want to know what it looks like. This is particularly useful when traveling to new areas as landmarks can be easily identified ahead of time. Recently Microsoft released documentation on how to develop against this 3D API (http://blogs.msdn.com/virtualearth3d/archive/2009/01/25/documentation.aspx). Infusion development has been working with Virtual Earth 3D for well over a year now developing business applications. Most of these applications have been developed for the Microsoft Surface. Videos of various applications can be found here: http://www.youtube.com/InfusionDevelopment

One thing I’ve noticed is that there hasn’t been a lot of development against the 3D API yet outside of the business world. This article is going to show you how to create a simple flight simulator plug-in for Virtual Earth. Here is a screen shot of the finished product to get you motivated to read through this article. You can also download the source code for this here: http://cid-e7dba9a4bfd458c5.skydrive.live.com/self.aspx/VE%20Sample%20code/SimpleFlightSimulator.zip

Note you will need to re-add the references to the Virtual Earth DLL’s.

clip_image002 

Here is a video to show it in action. Note I was just using the keyboard for the navigation in this screen capture.

   

Here is a video of it in action using an XBox 360 controller to navigate. 

The first step is to install the Virtual Earth 3D control if you haven’t done so already. You can download it here: http://maps.live.com/Help/VE3DInstall/

The second step is to create an ASP >NET Web Application project. In Visual Studios 2008 you will have to do the following steps:

  1. Open Visual Studio 2005/2008.
  2. From the File menu, choose New | Project.
  3. Choose one of the Project Types. For example, Visual C#.
  4. From the Templates list, choose Class Library.
  5. Call the project SimpleFlightSimulator and verify the project Location.
  6. Click OK to create the solution.

The next step is to reference the Virtual Earth 3D DLL’s.

1. From the Solution Explorer, right click the project name and click Add Reference.

  1. In the popup window, click the Browse tab and navigate to the location where you installed the Virtual Earth 3D application. (eg. C:\Program Files\Virtual Earth 3D)
  2. Hold the CTRL key down and select:
    Microsoft.MapPoint.Data
    Microsoft.MapPoint.Geometry

Microsoft.MapPoint.Graphics3D
Microsoft.MapPoint.Rendering3D
Microsoft.MapPoint.Rendering3D.Utility
Microsoft.MapPoint.UtilityPartialTrust

4. A reference to System.Drawing, System.IO, System.Runtime.InteropServices, System.Threading and System.Reflection will also be needed.

  1. Click the OK button.

Now you will have to create the plug-in class. This can be done by doing the following:

1. Right click the new project’s name and select Add | New Item.

  1. Under Visual C# Items | Code, select the Class item and call your class SimpleFlightSimulatorPlugin.cs
  2. Click the Add button and open the newly created file. This file will represent our plug-in for this example.
  3. The first thing we need to do with this new plug-in is create a unique identifier. We do this using the GUID tool:
    1. In Visual Studio, click Tools | Create GUID.
    2. Select the Registry Format option.
    3. Click the New GUID button, and then the Copy button.
  4. Paste the GUID as an attribute of your class.
  5. Derive your class from the PlugIn class.

Part 2 – http://rbrundritt.spaces.live.com/blog/cns!E7DBA9A4BFD458C5!752.entry
Part 3 – http://rbrundritt.spaces.live.com/blog/cns!E7DBA9A4BFD458C5!751.entry
Part 4 – http://rbrundritt.spaces.live.com/blog/cns!E7DBA9A4BFD458C5!750.entry

About these ads

One thought on “Virtual Earth 3D Flight Simulator

  1. Pingback: An Unlikely Replacement for the Bing Maps 3D Control | Alastair Aitchison

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s