| When the Microsoft Virtual Earth team released version 6 of the Virtual Earth SDK, they also unveiled an application, in conjunction with 3DVIA, called Virtual Earth - 3DVIA which allows for the creation of 3D models for inclusion in Virtual Earth applications. For this experiment, we are going to make use of this program to create some 3D content for our Virtual Earth applications.

First things first, you are going to need a Windows Live ID for this experiment. If you do not already have one, you can sign-up for one here. Point your browser to http://maps.live.com and, if you have not already done so, log-in with your Windows Live ID. The map has to be in 3D mode to be able to add 3D models, so click the 3D button in the map control. Once the 3D version of the map is displayed, right-clicking on the map should bring up a context menu with the option “Add a 3D model”.

Selecting the “Add a 3D model” option will launch Virtual Earth - 3DVIA. If it is not yet installed on your machine, you will be walked through the installation process. Once the application launches, you will be asked to log-in with your Windows Live ID again. The map imagery surrounding the point you selected will be pulled into Virtual Earth - 3DVIA. Note: the application will use map tiles from whichever map style is currently selected.

Virtual Earth - 3DVIA has several drawing tools. We are going to select the rectangle tool and draw a simple rectangle over the top of our imagery.

After creating a our two-dimensional shape, you can then use the “Extrude” tool to give our shape some height in order to take advantage of all that wonderful, 3rd-dimensional real estate.

Those are the basic (very basic) concepts in creating 3D models for Virtual Earth. If you are interested in learning more about the nuances of 3D modeling with Virtual Earth - 3DVIA, you can access some tutorials provided by Microsoft here.
Now here’s the point at which we borrow a page from the playbook of those cable cooking shows. I showed you how to prepare the dish and now, we take the fully cooked meal out of the oven. Abhinav Dayal, one of my talented colleagues at IDV, put together this awesome model of our offices in Virtual Earth - 3DVIA. As you can see, it’s a bit more interesting than our simple, extruded rectangle.

Once the model is complete, click the “Publish” button to save your model and send it to the Virtual Earth map open in your browser.

If you had a collection open when you added the 3D model, the model will be added to that collection. Otherwise, the model will be added to the temporary, “Unsaved collection”. Save the collection and make sure to turn on sharing in the collection properties.
To view this collection outside of maps.live.com we need to know what the collection ID is. This can be obtained by selecting “Copy to Clipboard” from the “Share” menu when the desired collection is open.

Once you paste the contents of the clipboard into a text editor, you should see a url like this:
http://maps.live.com/default.aspx?v=2&cp=42.671429~-84.534895&style=h&lvl=7&
tilt=-90&dir=0&alt=840779.086514725&cam=42.671429~-84.534895&scene=-1&
cid=BB5F2FA205325EA0!113&encType=1
I’ve emboldened the cid property, ‘c’ in this case standing for “collection”. We can now use this value to bring this collection into an application making use of the Virtual Earth SDK. This involves creating a new VEMap.VEShapeSourceSpecification object as such: var x = new VEShapeSourceSpecification(VEDataType.VECollection, [Collection ID], [Layer Name]);
You can view the final product of our experiment here.
|
February 5th, 2008 at 12:29 pm
Great job! I really like the final product and just spent some time flying around your building.
February 28th, 2008 at 5:00 am
[…] in Web Applications using Live Maps Collections and the VE API. IDV Solutions has followed with a similar tutorial showing how they built this application that displays their office building on the 3D Web. You can […]