<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Virtual Earth 3D team blog : Plug-In</title><link>http://blogs.msdn.com/virtualearth3d/archive/tags/Plug-In/default.aspx</link><description>Tags: Plug-In</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Two good questions</title><link>http://blogs.msdn.com/virtualearth3d/archive/2009/12/08/two-good-questions.aspx</link><pubDate>Tue, 08 Dec 2009 18:52:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9934226</guid><dc:creator>NikolaiF</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/virtualearth3d/comments/9934226.aspx</comments><wfw:commentRss>http://blogs.msdn.com/virtualearth3d/commentrss.aspx?PostID=9934226</wfw:commentRss><description>&lt;P&gt;Posting some answers to questions I've gotten recently.&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Bug in the samples:&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;Kind of silly that I hadn't noticed this until now, but there's an error in the sample html for most of the samples.&amp;nbsp; The name of the functions used for plug-in load and activate conflict with an internal name used in the AJAX code.&amp;nbsp; Change "On3DPlugInLoaded" and "On3DPlugInActivated" to any other name, for example "PlugInLoaded" and "PlugInActivated".&amp;nbsp; Remember to change both your function name and the string passed to AttachEvent.&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Zoom or Rotate around a point:&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;There have been several requests about how to allow people to zoom or rotate around a particular point on the screen, rather than the center.&amp;nbsp; The &lt;A title="Rotate/Zoom code" href="http://www.veteam.members.winisp.net/Spaceland/blog/PointZoomRotatePlugIn.zip" mce_href="http://www.veteam.members.winisp.net/Spaceland/blog/PointZoomRotatePlugIn.zip"&gt;code&lt;/A&gt;&amp;nbsp;here isn't as cleaned up as I normally like it, but it illustrates the ideas.&amp;nbsp; You can do the rotate by purely calling built-in VE3D functions via the bindings system, but zoom requires a bit more work.&amp;nbsp; To run the code, replace files in the Multitouch &lt;A title=Samples href="http://blogs.msdn.com/virtualearth3d/archive/2008/09/25/current-samples.aspx" target=_blank mce_href="http://blogs.msdn.com/virtualearth3d/archive/2008/09/25/current-samples.aspx"&gt;sample&lt;/A&gt; with the files in the zip.&amp;nbsp; You will want to call or adapt the calls to GestureEventSource to be in response to your inputs, rather than the worker thread I created.&lt;/P&gt;
&lt;P&gt;Remember you can contact me any time via the contact form, or if you prefer via comments.&amp;nbsp; Even if it looks like I haven't posted recently :)&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9934226" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Plug-In/default.aspx">Plug-In</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Camera/default.aspx">Camera</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Bing+Maps+3D/default.aspx">Bing Maps 3D</category></item><item><title>Multitouch in VE3D</title><link>http://blogs.msdn.com/virtualearth3d/archive/2009/03/04/multitouch-in-ve3d.aspx</link><pubDate>Wed, 04 Mar 2009 21:24:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9458806</guid><dc:creator>NikolaiF</dc:creator><slash:comments>11</slash:comments><comments>http://blogs.msdn.com/virtualearth3d/comments/9458806.aspx</comments><wfw:commentRss>http://blogs.msdn.com/virtualearth3d/commentrss.aspx?PostID=9458806</wfw:commentRss><description>&lt;P&gt;Ever since I got a Touchsmart at home I've been very interested in the desktop touch experience, and so in the last couple days I decided to play with how I could incorporate it into VE3D.&amp;nbsp; The code itself isn't really ready for consumption, but if you'd like to see where I'm at, I've built a very preliminary plug-in that you can install and play with.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.veteam.members.winisp.net/Spaceland/blog/MultitouchPlugInSetup.exe" mce_href="http://www.veteam.members.winisp.net/Spaceland/blog/MultitouchPlugInSetup.exe"&gt;Download&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;This requires Windows 7 and a machine that has multitouch support, such as a Touchsmart or Latitude XT.&amp;nbsp; The package is a self-extracting zip, just run it and accept the defaults.&amp;nbsp; The next time you launch VE3D, the plug-in will load shortly after startup.&amp;nbsp; There's no UI or anything.&amp;nbsp; The gestures will just quietly start working.&amp;nbsp; The plug-in will work on any app that uses GlobeControl (and loads it), but since it calls native code it does require &lt;A href="http://blogs.msdn.com/virtualearth3d/archive/2008/05/01/installing-plug-ins.aspx" mce_href="http://blogs.msdn.com/virtualearth3d/archive/2008/05/01/installing-plug-ins.aspx"&gt;installation&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Currently supported are two-finger zoom and two-finger rotate.&amp;nbsp; I'm using the built-in gesture engine from Win7, which makes things very easy, but in the future I would like to use direct touch input instead.&amp;nbsp; This&amp;nbsp;should eliminate a few artifacts like a momentary delay between when you start input and when the map starts moving.&amp;nbsp; It should also allow support of some more interesting types of inputs, like a two-finger pan, combining rotate and zoom into a single fluid motion, etc.&amp;nbsp; The point is that there's a lot of potential beyond what I've done here.&lt;/P&gt;
&lt;P&gt;The touch interface in Win7 relies on Windows Messages and a few native functions.&amp;nbsp; To listen to Windows Messages, use Host.CommunicationManager.AttachToMessage.&amp;nbsp; To interact with the native gesture API, &lt;A href="http://www.veteam.members.winisp.net/Spaceland/blog/NativeGestures.zip" mce_href="http://www.veteam.members.winisp.net/Spaceland/blog/NativeGestures.zip"&gt;here's something to get you started&lt;/A&gt;&amp;nbsp;(this code will work just as well in any managed application).&amp;nbsp; After that it's a matter of redirecting gestures to existing navigation Actions using bindings.&amp;nbsp; To really do it right you'd probably also want to write a few things in your own CameraController.&lt;/P&gt;
&lt;P&gt;Here's the &lt;A href="http://msdn.microsoft.com/en-us/library/dd353239(VS.85).aspx" target=_blank mce_href="http://msdn.microsoft.com/en-us/library/dd353239(VS.85).aspx"&gt;gesture documentation&lt;/A&gt; on MSDN.&amp;nbsp; Here's the &lt;A href="http://msdn.microsoft.com/en-us/library/dd317321(VS.85).aspx" target=_blank mce_href="http://msdn.microsoft.com/en-us/library/dd317321(VS.85).aspx"&gt;raw touch docs&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Note:&amp;nbsp; there's a bug in the current GlobeControl where the lParam and wParam values are reversed in the handler to AttachToMessage.&amp;nbsp; Whoops!&amp;nbsp; This is fixed in the next version, so be prepared.&amp;nbsp; I will be releasing my code as a sample at that time, and will update the installer as well.&lt;/P&gt;
&lt;P&gt;Note 2:&amp;nbsp; I noticed on my Touchsmart that the rotate gesture has some trouble when your fingers are diagonal relative&amp;nbsp;to the screen.&amp;nbsp; I think this is a driver thing, since it doesn't happen on the Latitude XT, which uses a different touch technology and, obviously, different drivers.&amp;nbsp; However, it looks like they are releasing improved drivers on Windows Update, so I hope this is just a bleeding edge thing.&lt;/P&gt;
&lt;P&gt;Edit:&amp;nbsp; the "Download" link has been updated to a version that is compatible with the current build on Virtual Earth 3D.&amp;nbsp; Please uninstall the old version first and then install the new one.&amp;nbsp; Functionality is still the same, that is to say, less than ideal.&amp;nbsp; From what I have seen, using WM_TOUCH instead of WM_GESTURE will provide a far superior experience.&amp;nbsp; Stay tuned.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9458806" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/VE3D/default.aspx">VE3D</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Plug-In/default.aspx">Plug-In</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Windows+7/default.aspx">Windows 7</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Multitouch/default.aspx">Multitouch</category></item><item><title>Animation Redux</title><link>http://blogs.msdn.com/virtualearth3d/archive/2008/11/11/animation-redux.aspx</link><pubDate>Tue, 11 Nov 2008 04:05:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9059049</guid><dc:creator>NikolaiF</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/virtualearth3d/comments/9059049.aspx</comments><wfw:commentRss>http://blogs.msdn.com/virtualearth3d/commentrss.aspx?PostID=9059049</wfw:commentRss><description>&lt;P&gt;This sample was &lt;A class="" title=Animation href="http://blogs.msdn.com/virtualearth3d/archive/2008/07/08/animation.aspx" mce_href="http://blogs.msdn.com/virtualearth3d/archive/2008/07/08/animation.aspx"&gt;released before&lt;/A&gt;, but didn't have a version that could run on the web without an install.&lt;/P&gt;
&lt;P&gt;&lt;A class="" title="Get the code!" href="http://blogs.msdn.com/virtualearth3d/archive/2008/09/25/current-samples.aspx" mce_href="http://blogs.msdn.com/virtualearth3d/archive/2008/09/25/current-samples.aspx"&gt;The new version&lt;/A&gt;&amp;nbsp;in the samples pack is almost exactly the same, so I won't go over it again in detail.&amp;nbsp; This post is just to show it off interactively.&lt;/P&gt;
&lt;P&gt;&lt;A class="" title="Bezier Surface Animation" href="http://www.veteam.members.winisp.net/Spaceland/Samples/BezierSurface/TestPage.htm" target=_blank mce_href="http://www.veteam.members.winisp.net/Spaceland/Samples/BezierSurface/TestPage.htm"&gt;&lt;IMG title="Bezier Surface Animation" style="WIDTH: 747px; HEIGHT: 488px" height=488 alt="Bezier Surface Animation" src="http://www.veteam.members.winisp.net/Spaceland/Samples/BezierSurface/sample.jpg" width=747 mce_src="http://www.veteam.members.winisp.net/Spaceland/Samples/BezierSurface/sample.jpg"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A class="" title="Bezier Surface Animation" href="http://www.veteam.members.winisp.net/Spaceland/Samples/BezierSurface/TestPage.htm" target=_blank mce_href="http://www.veteam.members.winisp.net/Spaceland/Samples/BezierSurface/TestPage.htm"&gt;See it in action!&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;When the page loads, press "S" after the text appears.&amp;nbsp; You can then grab the green balls with the mouse to deform the surface.&amp;nbsp; Left-click and drag causes it to deform to the new location and then slowly return; right-click and drag causes it to move to the new shape permanently.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9059049" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/VE3D/default.aspx">VE3D</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Plug-In/default.aspx">Plug-In</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Actor/default.aspx">Actor</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Animation/default.aspx">Animation</category></item><item><title>Actors and DataSources</title><link>http://blogs.msdn.com/virtualearth3d/archive/2008/10/27/actors-and-datasources.aspx</link><pubDate>Mon, 27 Oct 2008 23:51:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9019051</guid><dc:creator>NikolaiF</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/virtualearth3d/comments/9019051.aspx</comments><wfw:commentRss>http://blogs.msdn.com/virtualearth3d/commentrss.aspx?PostID=9019051</wfw:commentRss><description>&lt;P&gt;In this sample, we create a DataSource, which is a class that can be used for large-scale data sets.&amp;nbsp; It provides hooks into the system's spatial index, memory cache, and background data threads.&amp;nbsp; Data from the DataSource will only be requested when it is in view, and will be automatically cached according to how often it is used and how much memory it consumes.&amp;nbsp; The DataSource we create is a purely generated one consisting of a large number of animated bunnies spread&amp;nbsp;evenly across the globe, and would be impossibly large to try to deal with all at once.&lt;/P&gt;
&lt;P&gt;&lt;A class="" title="Bunny Sample" href="http://www.veteam.members.winisp.net/Spaceland/Samples/ActorDataSource/TestPage.htm" target=_blank mce_href="http://www.veteam.members.winisp.net/Spaceland/Samples/ActorDataSource/TestPage.htm"&gt;&lt;IMG title="Bunny Sample" style="WIDTH: 916px; HEIGHT: 685px" height=685 alt="Bunny Sample" src="http://www.veteam.members.winisp.net/Spaceland/Samples/ActorDataSource/sample.jpg" width=916 mce_src="http://www.veteam.members.winisp.net/Spaceland/Samples/ActorDataSource/sample.jpg"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A class="" title="Bunny Sample" href="http://www.veteam.members.winisp.net/Spaceland/Samples/ActorDataSource/TestPage.htm" target=_blank mce_href="http://www.veteam.members.winisp.net/Spaceland/Samples/ActorDataSource/TestPage.htm"&gt;See it in action!&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When the PlugIn is Activated, the ActorDataSource is created and added to the system.&amp;nbsp; When we create the DataSource we set up its Ontology, which is a system for defining the type of data the DataSource contains.&lt;/P&gt;
&lt;P&gt;The next time the Camera Query runs, a set of areas in the Spatial Index that are in view are determined,&amp;nbsp;called tiles.&amp;nbsp; Each tile is sent as a lat/long bounding box to the Data Threads, which call all added DataSources, including ours.&amp;nbsp; The entry point here is QueryPrimitivesInternal.&amp;nbsp; In this function we would normally do some sort of query to a backend, such as a SQL database or the network, but for simplicity we simply create a BunnyPrimitive in the center of the query region.&amp;nbsp; A primitive is a piece of data that represents a thing in the world, in the case a Bunny, but is not itself an Actor.&amp;nbsp; When we return the Primitive, it is passed to our ActorBuilder, called BunnyBuilder.&amp;nbsp; This creates actual Actors which can render or react to the data&amp;nbsp;represented by each Primitive.&amp;nbsp; Each Actor also needs an ActorBounds, which represents a spatial area that, when&amp;nbsp;in view, should cause it to render.&amp;nbsp; When this happens each Actor's Update and Render functions are called on the Render Thread just like normal Actors.&lt;/P&gt;
&lt;P&gt;&lt;A class="" title="Get the code!" href="http://blogs.msdn.com/virtualearth3d/archive/2008/09/25/current-samples.aspx" mce_href="http://blogs.msdn.com/virtualearth3d/archive/2008/09/25/current-samples.aspx"&gt;Get the code!&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9019051" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Code/default.aspx">Code</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/VE3D/default.aspx">VE3D</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Plug-In/default.aspx">Plug-In</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/DataSource/default.aspx">DataSource</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Actor/default.aspx">Actor</category></item><item><title>Camera Control</title><link>http://blogs.msdn.com/virtualearth3d/archive/2008/10/22/camera-control.aspx</link><pubDate>Wed, 22 Oct 2008 20:02:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9011369</guid><dc:creator>NikolaiF</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/virtualearth3d/comments/9011369.aspx</comments><wfw:commentRss>http://blogs.msdn.com/virtualearth3d/commentrss.aspx?PostID=9011369</wfw:commentRss><description>&lt;P&gt;In this sample, we create a plug-in to move the camera to a random location in the world every time a HTML button is pressed.&amp;nbsp; It demonstrates basic plug-in loading, writing and using a CameraController, and communicating between a plug-in and the hosting web page via Events.&lt;/P&gt;
&lt;P&gt;&lt;A class="" title="Camera Control" href="http://www.veteam.members.winisp.net/Spaceland/Samples/Camera/TestPage.htm" target=_blank mce_href="http://www.veteam.members.winisp.net/Spaceland/Samples/Camera/TestPage.htm"&gt;See it in action.&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Camera controllers&amp;nbsp;are important because it provides a single and consistent way of updating the camera.&amp;nbsp; Consistency is important because the camera needs to be in one position throughout an entire frame -- otherwise one part of the code may think the camera is in one place while another thinks it's elsewhere.&amp;nbsp; This is why you normally read the camera through its Snapshot in the SceneState object, and can only set it via a controller, of which there may only be one active at a time.&lt;/P&gt;
&lt;P&gt;Normally you position the camera with two properties, the position and the orientation.&amp;nbsp; Either can be set in terms of global or local coordinates.&amp;nbsp; Global essentially means relative to the center of the earth, while local means relative to your current location on the globe.&amp;nbsp; For position, global coordinates are in terms of Vector3D, local in terms of latitude, longitude, and altitude.&amp;nbsp; For orientation, you would normally set it globally in terms of lookat and lookup, Vector3Ds, and locally in terms of roll, pitch, and yaw.&amp;nbsp; See the &lt;A class="" title="Basic Math" href="http://blogs.msdn.com/virtualearth3d/archive/2008/05/06/basic-math.aspx" mce_href="http://blogs.msdn.com/virtualearth3d/archive/2008/05/06/basic-math.aspx"&gt;Basic Math&lt;/A&gt; entry for more.&lt;/P&gt;
&lt;P&gt;When this plug-in is Activated, it creates a new JumpController and begins listening to an event from CommunicationManager, but otherwise doesn't do anything.&amp;nbsp; The script on TestPage.htm is then able to raise that event, which causes JumpHandler to be fired.&amp;nbsp; A new random position is generated and given to the JumpController.&amp;nbsp; The JumpController is then set to be the current CameraController.&amp;nbsp; The next time the render thread calls the CameraStep, the JumpController will be called instead of the Default controller.&amp;nbsp; The JumpController's Activate function is called first, and it indicates that HasArrived&lt;BR&gt;is false, which means it still has work to do.&amp;nbsp; The MoveCamera is called, and the JumpController is allowed to modify its Camera property.&amp;nbsp; The CameraStep will use these values to set up the next scene and frame for rendering.&amp;nbsp; In addition, the JumpController sets HasArrived to true, indicating it has&lt;BR&gt;completed its work.&amp;nbsp; This causes the system to automatically swap JumpController's Next controller to be the Current one, in this case simply restoring control to the Default.&lt;/P&gt;
&lt;P&gt;If we wanted to animate to the location, we would adjust the current position a little at a time over a series of calls to MoveCamera, and only when we are down would we set HasArrived to true.&amp;nbsp; We could also take over completely, using Bindings to detect user input and making changes to Camera as needed,&lt;BR&gt;and only setting HasArrived when we want to return control to the Default.&lt;/P&gt;
&lt;P&gt;Note, at this time we only support one camera and one viewpoint at a time.&lt;/P&gt;
&lt;P&gt;&lt;A class="" title="Code samples" href="http://blogs.msdn.com/virtualearth3d/archive/2008/09/25/current-samples.aspx" mce_href="http://blogs.msdn.com/virtualearth3d/archive/2008/09/25/current-samples.aspx"&gt;Get the code!&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9011369" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/VE3D/default.aspx">VE3D</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Plug-In/default.aspx">Plug-In</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Math/default.aspx">Math</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Camera/default.aspx">Camera</category></item><item><title>Terrain Imagery Overlays</title><link>http://blogs.msdn.com/virtualearth3d/archive/2008/10/12/terrain-imagery-overlays.aspx</link><pubDate>Sun, 12 Oct 2008 20:15:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8996717</guid><dc:creator>NikolaiF</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/virtualearth3d/comments/8996717.aspx</comments><wfw:commentRss>http://blogs.msdn.com/virtualearth3d/commentrss.aspx?PostID=8996717</wfw:commentRss><description>&lt;P&gt;There are four ways to add custom imagery to VE3D.&amp;nbsp; The first three involve using built-in classes, and you just have to provide information on where to get the data.&amp;nbsp; The fourth involves implementing your own DataSource.&lt;/P&gt;
&lt;P&gt;&lt;A class="" title="Terrain Image Overlays" href="http://www.veteam.members.winisp.net/Spaceland/Samples/TerrainImages/TestPage.htm" target=_blank mce_href="http://www.veteam.members.winisp.net/Spaceland/Samples/TerrainImages/TestPage.htm"&gt;&lt;IMG title="Terrain Imagery Overlays" style="WIDTH: 737px; HEIGHT: 529px" height=529 alt="Terrain Imagery Overlays" src="http://www.veteam.members.winisp.net/Spaceland/Samples/TerrainImages/sample.jpg" width=737 mce_src="http://www.veteam.members.winisp.net/Spaceland/Samples/TerrainImages/sample.jpg"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A class="" title="Terrain Image Overlays" href="http://www.veteam.members.winisp.net/Spaceland/Samples/TerrainImages/TestPage.htm" target=_blank mce_href="http://www.veteam.members.winisp.net/Spaceland/Samples/TerrainImages/TestPage.htm"&gt;See it in action!&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This sample demonstrates how to add common terrain imagery data to the world, and adds a simple tour to display the example data sets.&amp;nbsp; We then use two events, one a built in data load event, and the other a custom event we created using the Step class, to tell the control to FlyTo a series of locations.&lt;/P&gt;
&lt;P&gt;When the PlugIn is Activated, we create three datasources using built-in settings.&amp;nbsp; The first uses a SingleImageDataSource, which reads data from a Bitmap object in memory and draws it on the terrain.&amp;nbsp; The second uses a "content manifest", which is an xml file that describes the data, how to display it, and where to get it.&amp;nbsp; An example is &lt;A class="" title="Aerial with Labels manifest" href="http://maps.live.com/Manifests/HT.xml" target=_blank mce_href="http://maps.live.com/Manifests/HT.xml"&gt;here&lt;/A&gt;.&amp;nbsp; The last uses a parameter string, and is similar to &lt;A class="" title=VETileSourceSpecification href="http://msdn.microsoft.com/en-us/library/bb544970.aspx" target=_blank mce_href="http://msdn.microsoft.com/en-us/library/bb544970.aspx"&gt;VETileSourceSpecification&lt;/A&gt;.&amp;nbsp; The % replacement variables in tilesource have the same numbers as those listed at the top of the xml manifest.&amp;nbsp; The parameter string is also a good method for adding WMS server data.&lt;/P&gt;
&lt;P&gt;It is also possible to create your own datasources.&lt;/P&gt;
&lt;P&gt;&lt;A class="" title="Mandelbrot Image DataSource" href="http://www.veteam.members.winisp.net/Spaceland/Samples/Mandelbrot/testpage.htm" target=_blank mce_href="http://www.veteam.members.winisp.net/Spaceland/Samples/Mandelbrot/testpage.htm"&gt;&lt;IMG title="Mandelbrot Image DataSource" style="WIDTH: 829px; HEIGHT: 663px" height=663 alt="Mandelbrot Image DataSource" src="http://www.veteam.members.winisp.net/Spaceland/Samples/Mandelbrot/sample.jpg" width=829 mce_src="http://www.veteam.members.winisp.net/Spaceland/Samples/Mandelbrot/sample.jpg"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A class="" title="Mandelbrot Image DataSource" href="http://www.veteam.members.winisp.net/Spaceland/Samples/Mandelbrot/testpage.htm" target=_blank mce_href="http://www.veteam.members.winisp.net/Spaceland/Samples/Mandelbrot/testpage.htm"&gt;See it in action!&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;This sample demonstrates how to add terrain imagery via a custom datasource.&amp;nbsp; This one generates a colored Mandelbrot set.&lt;/P&gt;
&lt;P&gt;When the PlugIn is Activated, we create our DataSource and add it to the system.&amp;nbsp; We also save off any existing datasources so we can add them back again later.&amp;nbsp; Once it is added, the data threads query it when we move into a new area, entering at QueryPrimitivesInternal.&amp;nbsp; We use the bounding area of the query to generate an appropriate section of the Mandelbrot set, and return it as a rasterized image.&amp;nbsp; This image is then displayed by the system.&lt;/P&gt;
&lt;P&gt;This method is good if you have special request logic, or want to do some of the work client-side (in this case, all the work is client-side).&amp;nbsp; This saves you from having to have a large server dataset of pre-rendered tiles, or execute expensive code on your servers.&amp;nbsp; There are notes in the sample code for how to use this code to get information about the area you are looking at and generate appropriate request URLs, etc.&lt;/P&gt;
&lt;P&gt;&lt;A class="" title="Sample code" href="http://blogs.msdn.com/virtualearth3d/archive/2008/09/25/current-samples.aspx" mce_href="http://blogs.msdn.com/virtualearth3d/archive/2008/09/25/current-samples.aspx"&gt;Get the code!&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8996717" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/VE3D/default.aspx">VE3D</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Plug-In/default.aspx">Plug-In</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/DataSource/default.aspx">DataSource</category></item><item><title>Controlling Time</title><link>http://blogs.msdn.com/virtualearth3d/archive/2008/10/05/controlling-time.aspx</link><pubDate>Sun, 05 Oct 2008 22:11:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8977220</guid><dc:creator>NikolaiF</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/virtualearth3d/comments/8977220.aspx</comments><wfw:commentRss>http://blogs.msdn.com/virtualearth3d/commentrss.aspx?PostID=8977220</wfw:commentRss><description>&lt;P&gt;&lt;IMG title="Sunrise in New York" style="WIDTH: 825px; HEIGHT: 596px" height=596 alt="Sunrise in New York" src="http://www.veteam.members.winisp.net/Spaceland/Samples/Time/sample.jpg" width=825 mce_src="http://www.veteam.members.winisp.net/Spaceland/Samples/Time/sample.jpg"&gt;&lt;/P&gt;
&lt;P&gt;Today we show a little of the "Time" sample.&amp;nbsp;&amp;nbsp;&amp;nbsp;It demonstrates how to use the concepts of rendering time and world time.&lt;/P&gt;
&lt;P&gt;In any rendering or simulation engine it is important to understand the system's concepts of time.&amp;nbsp; VE3D uses two time concepts.&amp;nbsp; The first is "rendering time", which is a time value specified at the beginning of each frame that should be used for all animation that frame.&amp;nbsp; This value enables synchronization of all animation in the system, and accounts for things like changes in frame rate. The second is "world time", which is the time of day that is used in the system.&amp;nbsp; Using this value enables everything that depends on time of day to be synchronized.&lt;/P&gt;
&lt;P&gt;Both values can also be overridden.&amp;nbsp; Rendering time can be overridden by replacing the "TimeStep"&amp;nbsp;with a custom step.&amp;nbsp; This is useful when, for example, recording a movie of an expensive animation.&amp;nbsp; Smooth animation and framerate can be achieved despite the fact that the animation itself may be&amp;nbsp;too expensive to render in realtime.&amp;nbsp; Demonstrated in this sample is overriding world time to affect the sun and stars.&lt;/P&gt;
&lt;P&gt;&lt;A class="" title="Time Sample" href="http://www.veteam.members.winisp.net/Spaceland/Samples/Time/TestPage.htm" target=_blank mce_href="http://www.veteam.members.winisp.net/Spaceland/Samples/Time/TestPage.htm"&gt;Click here to see it in action.&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;There are two modes to this sample page.&amp;nbsp; The first simply speeds up time.&amp;nbsp; The second rapidly changes the day, but not the time of day, so, you will see the position of the sun at 9 am as the seasons change.&amp;nbsp; Fun things to notice:&amp;nbsp; the stars move (the constellations are correct, too), the sun moves, shadows move, clouds change color, and there are pretty sunsets and sunrises.&amp;nbsp; All this goodness is built in to the new version, but you can only get them if you play with time through the managed control.&lt;/P&gt;
&lt;P&gt;&lt;A class="" href="http://blogs.msdn.com/virtualearth3d/archive/2008/09/25/current-samples.aspx" mce_href="http://blogs.msdn.com/virtualearth3d/archive/2008/09/25/current-samples.aspx"&gt;Get the code&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8977220" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Code/default.aspx">Code</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Plug-In/default.aspx">Plug-In</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Virtual+Earth+3D/default.aspx">Virtual Earth 3D</category></item><item><title>Current Samples</title><link>http://blogs.msdn.com/virtualearth3d/archive/2008/09/25/current-samples.aspx</link><pubDate>Thu, 25 Sep 2008 20:28:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8965316</guid><dc:creator>NikolaiF</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/virtualearth3d/comments/8965316.aspx</comments><wfw:commentRss>http://blogs.msdn.com/virtualearth3d/commentrss.aspx?PostID=8965316</wfw:commentRss><description>&lt;P&gt;Here's the newest, most whiz-bang sample set we've got right at the moment.&lt;/P&gt;
&lt;P&gt;&lt;A class="" title="Get The Samples!" href="http://www.veteam.members.winisp.net/Spaceland/blog/VE3D_Samples_v4.zip" mce_href="http://www.veteam.members.winisp.net/Spaceland/blog/VE3D_Samples_v4.zip"&gt;Download&amp;nbsp;The Samples!&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A class="" href="http://www.veteam.members.winisp.net/Spaceland/Samplesv4/TestPage.htm" target=_blank mce_href="http://www.veteam.members.winisp.net/Spaceland/Samplesv4/TestPage.htm"&gt;See The Samples!&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;For the future, whenever we update the sample set we will update this post, to save you (and us) from having to slog through out-of-date links.&lt;/P&gt;
&lt;P&gt;Updated&amp;nbsp;April 9, 2009.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Current Control Version:&amp;nbsp; 4.0&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8965316" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Code/default.aspx">Code</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Plug-In/default.aspx">Plug-In</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Virtual+Earth+3D/default.aspx">Virtual Earth 3D</category></item><item><title>Animation</title><link>http://blogs.msdn.com/virtualearth3d/archive/2008/07/08/animation.aspx</link><pubDate>Wed, 09 Jul 2008 00:26:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8709951</guid><dc:creator>NikolaiF</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/virtualearth3d/comments/8709951.aspx</comments><wfw:commentRss>http://blogs.msdn.com/virtualearth3d/commentrss.aspx?PostID=8709951</wfw:commentRss><description>&lt;P&gt;Note:&amp;nbsp;&amp;nbsp;this entry references code for an older version of VE3D.&amp;nbsp; The newest code samples are &lt;A class="" href="http://blogs.msdn.com/virtualearth3d/archive/2008/09/25/current-samples.aspx" mce_href="http://blogs.msdn.com/virtualearth3d/archive/2008/09/25/current-samples.aspx"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Smoothly animated objects make for a more compelling 3D world, and in this entry we'll learn about using them.&amp;nbsp; In the X File entry, the model that we loaded could be rotated around a point.&amp;nbsp; This is pretty easy, but is limited.&amp;nbsp; You can move the model around, rotate it, make it bigger or smaller, but can't change its basic shape and appearance.&amp;nbsp; For complex animations like that, you may need to change the actual vertices or indices used to draw the model.&amp;nbsp; To support that, we have the concept of dynamic buffers.&amp;nbsp; These are buffers that are expected to be frequently recalculated, and are internally handled to make that more efficient.&amp;nbsp; The attached sample shows how to use this in SurfaceActor, but it's pretty much the same as using static buffers.&amp;nbsp; The only difference is that we Set the values in the buffer in every call to Update rather than just Add them once.&lt;FONT size=3&gt;&lt;/P&gt;
&lt;P&gt;&lt;A class="" href="http://auldane.members.winisp.net/msdn/BezierSurface.zip" mce_href="http://auldane.members.winisp.net/msdn/BezierSurface.zip"&gt;Get The Code.&lt;/A&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;EMBED pluginspage=http://macromedia.com/go/getflashplayer src=http://images.video.msn.com/flash/soapbox1_1.swf width=432 height=364 type=application/x-shockwave-flash flashvars="c=v&amp;amp;v=148e3d0c-1365-4da9-98fe-e3ce8667066e&amp;amp;ifs=true&amp;amp;fr=msnvideo&amp;amp;mkt=en-US&amp;amp;brand=" allowScriptAccess="always" allowFullScreen="true" base="http://images.video.msn.com" quality="high" mce_src="http://images.video.msn.com/flash/soapbox1_1.swf"&gt;&lt;/EMBED&gt;&lt;BR&gt;&lt;A title="Bezier Surface in Virtual Earth 3D" href="http://video.msn.com/video.aspx?vid=148e3d0c-1365-4da9-98fe-e3ce8667066e" target=_new mce_href="http://video.msn.com/video.aspx?vid=148e3d0c-1365-4da9-98fe-e3ce8667066e"&gt;Video: Bezier Surface in Virtual Earth 3D&lt;/A&gt; 
&lt;P&gt;When the code is normally running it does not draw a new frame as frequently as it could.&amp;nbsp; This is to conserve CPU and other resources on the client machine when nothing is really happening.&amp;nbsp; But when animating, this presents a problem because the aniamtion can look stuttery and inconsistent.&amp;nbsp; The solution is to tell the system it needs to draw more frequently by calling &lt;/P&gt;&lt;FONT size=2&gt;
&lt;P&gt;Host.NeedUpdate();&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;This can be called as many times per frame as you like, and simply sets a flag telling the system to render the next frame as soon as possible.&amp;nbsp; It's a good idea to only call this when you have an animation actively running.&amp;nbsp; In this case, it is called only when a ControlPoint is actually changing.&lt;/P&gt;
&lt;P&gt;This sample also has some code demonstrating more usage of bindings to control user input in a custom fashion, similar to the Geometry sample but a little more complex.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8709951" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Code/default.aspx">Code</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Plug-In/default.aspx">Plug-In</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Virtual+Earth+3D/default.aspx">Virtual Earth 3D</category></item><item><title>Installing Plug-Ins</title><link>http://blogs.msdn.com/virtualearth3d/archive/2008/05/01/installing-plug-ins.aspx</link><pubDate>Thu, 01 May 2008 20:08:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8447272</guid><dc:creator>NikolaiF</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/virtualearth3d/comments/8447272.aspx</comments><wfw:commentRss>http://blogs.msdn.com/virtualearth3d/commentrss.aspx?PostID=8447272</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;&lt;FONT face=Arial size=2&gt;Note:&amp;nbsp;&amp;nbsp;this entry references code for an older version of VE3D.&amp;nbsp; The newest code samples are &lt;/FONT&gt;&lt;A class="" href="http://blogs.msdn.com/virtualearth3d/archive/2008/09/25/current-samples.aspx" mce_href="http://blogs.msdn.com/virtualearth3d/archive/2008/09/25/current-samples.aspx"&gt;&lt;FONT face=Arial size=2&gt;here&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial size=2&gt;.&lt;/FONT&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Some types of plug-ins feature special data or rendering, and are intended to be used with a particular website.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Others are intended to enhance the experience of all websites, and run every time a user runs VE3D.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Most of the samples given so far have been about the former, where the test html page references the plug-in you wish to load.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Today we’ll talk about the latter.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;In addition, there is currently a limitation that plug-ins must be installed in the GAC in order to run.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This is true regardless of what category the plug-in falls under.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;End users of a plug-in will need a way of installing the plug-in.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Fortunately writing an installer is easy with Visual Studio.&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;&lt;A class="" title="The Code" href="http://kristoffer.members.winisp.net/VE3D/SetupSample.zip" mce_href="http://kristoffer.members.winisp.net/VE3D/SetupSample.zip"&gt;The Code&lt;/A&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;&lt;A class="" title="Download Shortcut Key Plug-In" href="http://kristoffer.members.winisp.net/VE3D/ShortcutPlugInSetup.exe" mce_href="http://kristoffer.members.winisp.net/VE3D/ShortcutPlugInSetup.exe"&gt;Download Shortcut Key Plug-In&lt;/A&gt;&lt;/FONT&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;The first link contains the source code for the plug-in itself and the deployment project.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The plug-in is set up to run in a test page just like the others, but the intended way to use this solution is to build PlugInSetup.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;That project will take the output of the plug-in project, add it to an MSI along with some appropriate verbiage, and a setup.exe bootstrapper to run the MSI.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Once those are built, the setup.exe and MSI combination can be distributed to end users.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;In my case, I created a self-extracting zip archive – the output is the second link. &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;Visual Studio won’t do this directly, so use your favorite tool to create a nice single package for users.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This method doesn’t necessarily create the most elegant installer, and any installer package that has the same features could be used, but this one works and is easy to use. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;The important parts of the PlugInSetup projects are the files to include and the various text messages to display.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Right click on the project name, and select View -&amp;gt; File System.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The file locations we’d like to install to are shown.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;In order to run an automatically-running plug-in, we must install to a special location under VE3D’s install path, as seen here.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;A plug-in that loads on demand, as from a custom website, would install to its own Program Files directory.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;For this plug-in, there are no user-specific resources so all users will be able to use the plug-in when they run VE3D.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;IMG title="Adding output to Program Files" style="WIDTH: 782px; HEIGHT: 378px" height=378 alt="Adding output to Program Files" src="http://kristoffer.members.winisp.net/VE3D/applicationfolder.png" width=782 mce_src="http://kristoffer.members.winisp.net/VE3D/applicationfolder.png"&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;We also must add our plug-in to the Global Assembly Cache.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This can be seen below.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;IMG title="Adding output to the GAC." style="WIDTH: 591px; HEIGHT: 183px" height=183 alt="Adding output to the GAC." src="http://kristoffer.members.winisp.net/VE3D/GAC.png" width=591 mce_src="http://kristoffer.members.winisp.net/VE3D/GAC.png"&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;New files may be added to both by right clicking in the right-hand side of the main view, and new locations may be added by right-clicking in the left-hand side.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;We may also modify various items like author name and contact info by clicking on the PlugInSetup project and looking at the properties page.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;&lt;IMG title="Deployment Project Properties page" style="WIDTH: 484px; HEIGHT: 464px" height=464 alt="Deployment Project Properties page" src="http://kristoffer.members.winisp.net/VE3D/properties.png" width=484 mce_src="http://kristoffer.members.winisp.net/VE3D/properties.png"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;The plug-in itself is a simple project to remember camera viewpoints and fly back to them when the user presses a key.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It has no UI elements except for notifications on error, which is desirable for a plug-in that will always be run.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Ideally, some form of instruction for the user would appear on startup or during the install but for now we are keeping it simple.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;To save a viewpoint, hold shift and then press a number key from 1 to 4.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;To return to that viewpoint, even after restarting the app, press the same number key again, this time without holding shift.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;To reset all the views, press 0.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;The project uses the bindings system with a config file, meaning that end users may change the keys used by editing the ShortcutBindings.xml file (see the code for comments on the location of this file).&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It also uses IsolatedStorage for safe persistence of data, unique to the plug-in and user (so different users may have different saved views).&amp;nbsp; The code has comments that hopefully explain what's going on, but some of it, bindings especially, will be a topic for a future post.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Enjoy!&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8447272" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Code/default.aspx">Code</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Plug-In/default.aspx">Plug-In</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Virtual+Earth+3D/default.aspx">Virtual Earth 3D</category></item><item><title>Adding a Virtual Earth 3D Plug-in to your webpage</title><link>http://blogs.msdn.com/virtualearth3d/archive/2008/04/11/adding-a-virtual-earth-3d-plug-in-to-your-webpage.aspx</link><pubDate>Sat, 12 Apr 2008 01:05:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8382427</guid><dc:creator>NikolaiF</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.msdn.com/virtualearth3d/comments/8382427.aspx</comments><wfw:commentRss>http://blogs.msdn.com/virtualearth3d/commentrss.aspx?PostID=8382427</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;Note:&amp;nbsp;&amp;nbsp;this entry references code for an older version of VE3D.&amp;nbsp; The newest code samples are &lt;A class="" href="http://blogs.msdn.com/virtualearth3d/archive/2008/09/25/current-samples.aspx" mce_href="http://blogs.msdn.com/virtualearth3d/archive/2008/09/25/current-samples.aspx"&gt;here&lt;/A&gt;.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;Want to try custom code for the 3D view of Virtual Earth?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This is the place to find out how!&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;What do I need?&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none; mso-add-space: auto; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;Virtual Earth 3D installed.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Navigate to maps.live.com, click the 3D button, and follow the upgrade/install steps.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none; mso-add-space: auto; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;Visual Studio 2005 or higher&amp;nbsp;and some c# coding skills (any .NET language actually, but samples will be in C#).&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none; mso-add-space: auto; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;A class="" href="http://auldane.members.winisp.net/msdn/Samples.zip" mce_href="http://auldane.members.winisp.net/msdn/Samples.zip"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;FONT color=#0000ff&gt;This package&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;If you do not have Visual Studio installed, you can download a free version of Visual Studio 2008 &lt;A class="" title=here href="http://www.microsoft.com/express/download/" target=_blank mce_href="http://www.microsoft.com/express/download/"&gt;here&lt;/A&gt;.&amp;nbsp; See notes at the end of the post for details.&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;Extract the samples zip to c:\Samples (or any other directory, but you'll have to fix up some paths in the projects).&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;There's a Readme, but you should be able to just open the sln in Visual Studio, set one of the projects to the Startup project, and hit F5.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;For this post, we'll just talk about the basics of how the plug-in will be loaded.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;Try building and launching the project SimpleObjectPlacement.&lt;/SPAN&gt;&lt;/P&gt;&lt;/SPAN&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&lt;IMG title="Selecting the Startup Project" style="WIDTH: 307px; HEIGHT: 402px" height=402 alt="Selecting the Startup Project" src="http://kristoffer.members.winisp.net/Images/VirtualEarth3D/startup.png" width=307 mce_src="http://kristoffer.members.winisp.net/Images/VirtualEarth3D/startup.png"&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-no-proof: yes"&gt;&lt;?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /&gt;&lt;v:shapetype id=_x0000_t75 stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"&gt;&lt;v:stroke joinstyle="miter"&gt;&lt;/v:stroke&gt;&lt;v:formulas&gt;&lt;v:f eqn="if lineDrawn pixelLineWidth 0"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum @0 1 0"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum 0 0 @1"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @2 1 2"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @3 21600 pixelWidth"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @3 21600 pixelHeight"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum @0 0 1"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @6 1 2"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @7 21600 pixelWidth"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum @8 21600 0"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @7 21600 pixelHeight"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum @10 21600 0"&gt;&lt;/v:f&gt;&lt;/v:formulas&gt;&lt;v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"&gt;&lt;/v:path&gt;&lt;o:lock aspectratio="t" v:ext="edit"&gt;&lt;/o:lock&gt;&lt;/v:shapetype&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;By default, you'll get an IE window with a script warning.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This only happens because we're loading the html off the local drive, and will not happen if we point to a web server.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-no-proof: yes"&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&lt;IMG title="Script warning in IE" style="WIDTH: 843px; HEIGHT: 105px" height=105 alt="Script warning in IE" src="http://kristoffer.members.winisp.net/Images/VirtualEarth3D/warning.png" width=843 mce_src="http://kristoffer.members.winisp.net/Images/VirtualEarth3D/warning.png"&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;You can change startup behavior by modifying the values in the Debug pane of the project.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&lt;IMG title="Debug pane of the project properties" style="WIDTH: 495px; HEIGHT: 257px" height=257 alt="Debug pane of the project properties" src="http://kristoffer.members.winisp.net/Images/VirtualEarth3D/debug.png" width=495 mce_src="http://kristoffer.members.winisp.net/Images/VirtualEarth3D/debug.png"&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-no-proof: yes"&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;Once there you should see the globe, and after a moment it will zoom to off the coast of Africa to see a floating cube.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-no-proof: yes"&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&lt;IMG title="Yay, a colored cube!" style="WIDTH: 517px; HEIGHT: 442px" height=442 alt="Yay, a colored cube!" src="http://kristoffer.members.winisp.net/Images/VirtualEarth3D/Cube.png" width=517 mce_src="http://kristoffer.members.winisp.net/Images/VirtualEarth3D/Cube.png"&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;So what happened?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;First, we have a very simple webpage that loads the JavaScript SDK, and then extracts the 3D control from it to do some special loading.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This is an unsupported thing to do (well heck, everything in these samples is unsupported, but that doesn’t mean it won’t work), but we need to get at the Events and LoadPlugInDll methods.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;map = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; VEMap(&lt;SPAN style="COLOR: #a31515"&gt;'myMap'&lt;/SPAN&gt;); &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;map.SetDashboardSize(VEDashboardSize.Normal);&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;map.LoadMap(&lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;, 2, &lt;SPAN style="COLOR: #a31515"&gt;'a'&lt;/SPAN&gt;, &lt;SPAN style="COLOR: blue"&gt;false&lt;/SPAN&gt;, VEMapMode.Mode3D);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;control3D = map.vemapcontrol.Get3DControl();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;control3D.AttachEvent(&lt;SPAN style="COLOR: #a31515"&gt;"OnPlugInLoaded"&lt;/SPAN&gt;, &lt;SPAN style="COLOR: #a31515"&gt;"On3DPlugInLoaded"&lt;/SPAN&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;control3D.AttachEvent(&lt;SPAN style="COLOR: #a31515"&gt;"OnPlugInActivated"&lt;/SPAN&gt;, &lt;SPAN style="COLOR: #a31515"&gt;"On3DPlugInActivated"&lt;/SPAN&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;control3D.AttachEvent(&lt;SPAN style="COLOR: #a31515"&gt;"OnPlugInDeactivated"&lt;/SPAN&gt;, &lt;SPAN style="COLOR: #a31515"&gt;"On3DPlugInDeactivated"&lt;/SPAN&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;control3D.LoadPlugInDll(&lt;SPAN style="COLOR: #a31515"&gt;"C:\\Samples\\SimpleObjectPlacement\\bin\\Debug\\SimpleObjectPlacement.dll"&lt;/SPAN&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;Events are just callbacks when certain things happen.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;In this case, when a plug-in is finished loading the SDK will try to call a function called "On3DPlugInLoaded".&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It has to be this way because the LoadPlugInDll method is asynchronous -- otherwise we'd have to sit and wait for loading to complete, causing a negative user experience.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;But you don't have to worry much about this, just know that you can listen to events and you'll be called when things happen.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;You can also fire your own events, which we'll get to later.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;In this case, if you look at the handler you'll see when we finish loading the plug-in we'll activate it.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;We could do more, but this is the minimum.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;You can specify a plug-in to load in two ways.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;First is like this, with a local file path.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Second is by specifying the fully qualified name.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Either method requires that the plug-in be installed in the GAC, which is an unfortunate security limitation that we hope to relax in the future.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;You can get installed into the GAC by using utilities that come with VS, or by writing an MSI installer.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;We'll get into more on that later.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;All the samples here install their output into the GAC as a post-build step to help you get past these details.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;When the plug-in is loaded, then we start executing the C# code.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;If you put breakpoints in SimpleObjectPlugIn.cs, you'll see it gets a call to the constructor, and then one to the Activate function.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;In a future post we'll walk through the details of what happens next, how the cube gets into the world, and why it changes color when you mouse over it.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;In the meantime, try playing with the other samples.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Let us know what you think, and please enjoy.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-pagination: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;A href="http://kristoffer.members.winisp.net/VE3D/Samples.zip"&gt;&lt;FONT face=Calibri color=#0000ff size=3&gt;Download Samples.zip&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;STRONG&gt;Notes on VS 2008 and VS 2008 Express:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;If you use either of these, you'll have to run the solution upgrade wizard.&amp;nbsp; It should be painless, but you may encounter&amp;nbsp;some of the following issues:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;VS 2008 Full and Express:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;If you get errors on build about gacutil and return code 3, you may need to update the path in the project pre- and post-build steps to &lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;"$(DevEnvDir)..\..\..\Microsoft SDKs\Windows\v6.0A\bin\gacutil".&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;VS 2008 Express:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;A message about a property not supported.&amp;nbsp; This is related to the last point below, and can be ignored.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;A message about Solution Items not supported (VS Express).&amp;nbsp; This is just the readme file and can be ignored (you can still read the readme by just navigating to c:\samples).&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;Express only builds to the Release bin path, so the html files (TestPage.htm) need to be updated such that the LoadPlugInDll call points to bin\\Release instead of bin\\Debug.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;VS Express doesn't support debugging a different process than the one launched.&amp;nbsp; This is tricky because&amp;nbsp;plug-ins run in the browser's process.&amp;nbsp; To run the plug-in samples you'll need to build the project, and then run the html file manually in your favorite browser.&amp;nbsp; However, you can debug a forms app as normal, so you can work around this by debugging your code inside the SimpleForm sample, and then copying to the plug-in.&amp;nbsp; We apologize for this inconvenience, but it was free after all ;)&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;STRONG&gt;&amp;nbsp;Update:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;The intellisense files in the samples zip have been updated to be more complete.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8382427" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Virtual+Earth/default.aspx">Virtual Earth</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Code/default.aspx">Code</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Plug-In/default.aspx">Plug-In</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Virtual+Earth+3D/default.aspx">Virtual Earth 3D</category></item></channel></rss>