<?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 : Code</title><link>http://blogs.msdn.com/virtualearth3d/archive/tags/Code/default.aspx</link><description>Tags: Code</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Hosting VE3D in native code</title><link>http://blogs.msdn.com/virtualearth3d/archive/2009/09/24/hosting-ve3d-in-native-code.aspx</link><pubDate>Thu, 24 Sep 2009 21:54:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9899105</guid><dc:creator>NikolaiF</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/virtualearth3d/comments/9899105.aspx</comments><wfw:commentRss>http://blogs.msdn.com/virtualearth3d/commentrss.aspx?PostID=9899105</wfw:commentRss><description>&lt;P&gt;Sorry for the glut of posts this week.&amp;nbsp; I hadn't been able to write much, but there were still interesting topics and questions coming up and I'm trying to address that backlog now.&amp;nbsp; So, without further ado:&lt;/P&gt;
&lt;P&gt;It is possible to host VE3D in a variety of contexts, and so far we've seen WinForms, WPF, and the browser.&amp;nbsp; It is also possible to host in straight native code.&amp;nbsp; In this sample, I address the COM interactions needed to host VE3D, and use OpenGL as an example hosting environment.&lt;/P&gt;
&lt;P&gt;Download the &lt;A title="Sample Code" href="http://www.veteam.members.winisp.net/Spaceland/blog/VE3DOpenGL.zip" mce_href="http://www.veteam.members.winisp.net/Spaceland/blog/VE3DOpenGL.zip"&gt;code here.&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH: 640px; HEIGHT: 490px" title="VE3D on an OpenGL cube" alt="VE3D on an OpenGL cube" src="http://www.veteam.members.winisp.net/Spaceland/blog/ve3dCube.jpg" width=640 height=490 mce_src="http://www.veteam.members.winisp.net/Spaceland/blog/ve3dCube.jpg"&gt;&lt;/P&gt;
&lt;P&gt;This sample demonstrates four concepts:&lt;/P&gt;
&lt;P&gt;Interaction with native code.&lt;BR&gt;Back buffer retrieval.&lt;BR&gt;Direct camera control.&lt;BR&gt;OpenGL integration.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Native code:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Managed code provides easy and convenient methods for exposing your code to COM, and hence to native callers.&lt;BR&gt;From the managed side, check "Register for COM interop" in your project's Build tab.&amp;nbsp; Decorate an interface&lt;BR&gt;with ComVisible(true) and provide a guid, and the backing class with the interface type as shown.&amp;nbsp; Your types&lt;BR&gt;are now visible and callable.&lt;/P&gt;
&lt;P&gt;On the native side, you can now instantiate your managed code using typical COM calls, as shown.&amp;nbsp; It can then&lt;BR&gt;be called similarly to any other object.&lt;/P&gt;
&lt;P&gt;To add a new function to the interface, simply add it to the interface file and the backing .cs file, then &lt;BR&gt;recompile.&amp;nbsp; By designing your interface in appropriately, you can then decide whether to do most of your logic&lt;BR&gt;in native or managed code, depending on where you feel more comfortable.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Backbuffer retrieval:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The Render function provides the most efficient way of pulling VE3D's back buffer into main memory.&amp;nbsp; In general&lt;BR&gt;it is better to not do this, rather let the hardware render to the screen directly, but some situations demand&lt;BR&gt;using the scene in some other fashion.&amp;nbsp; Here, we get the memory as a direct pointer.&amp;nbsp; Note that this approach&lt;BR&gt;assumes that you are handling any format and stride issues yourself.&lt;/P&gt;
&lt;P&gt;It is also possible to get a graphics object from systemMemorySurface, an HDC from that, and then use functions&lt;BR&gt;like BitBlt to copy out data and handle some of these issues for you.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Direct camera control:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Most samples thus far have demonstrated use of bindings and actions, or deriving camera controller.&amp;nbsp; The&lt;BR&gt;CameraController class here shows how to write a controller that can react directly to user input, modifying&lt;BR&gt;camera values directly.&amp;nbsp; The "best practices" method is to wrap your input device in a EventSource, and use&lt;BR&gt;bindings and actions to communicate the information to your controller.&amp;nbsp; These structures provide simple &lt;BR&gt;remapping of inputs, if necessary, and handle any threading or marshalling issues.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;However, it is also possible and sometimes appropriate to take the simpler approach used here.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;OpenGL integration:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;It is possible to integrate VE3D into an existing OpenGL application.&amp;nbsp; Using the Render method described above,&lt;BR&gt;the pointer produced is suitable for direct consumption by OpenGL.&amp;nbsp; There are differences in how textures are&lt;BR&gt;handled by the two APIs, but these are fairly simple to overcome, and are described in DrawOpenGLWindow().&lt;/P&gt;
&lt;P&gt;Note that there is nothing that limits this sample to OpenGL, anything that can consume the buffer as provided &lt;BR&gt;can host VE3D in the exact same manner.&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Note on debugging:&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;The Visual Studio debugger requires some direction on how to deal with mixed native and managed code.&lt;BR&gt;In the VE3DOpenGL properties page, expand Configuration Properties, click Debugging, then choose Debugger &lt;BR&gt;Type.&amp;nbsp; You can elect to only attach to native, only to managed, or to both ("mixed").&amp;nbsp; "Auto" in this case &lt;BR&gt;will be native-only.&amp;nbsp; If you find your breakpoints are not hitting, it is likely this setting.&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Note on glut.h:&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;For some reason, in the release version only, I managed to get it thinking that it needed glut and I haven't&lt;BR&gt;been able to figure out why.&amp;nbsp; If you encounter problems while compiling due to glut, just run in debug mode.&lt;BR&gt;This is a problem that is specific to the sample app, not the methodology used.&lt;/P&gt;
&lt;P&gt;Enjoy, and as usual please let me know about any questions or problems you may have.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9899105" 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/Bing+Maps+3D/default.aspx">Bing Maps 3D</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Rendering/default.aspx">Rendering</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/OpenGL/default.aspx">OpenGL</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/COM/default.aspx">COM</category></item><item><title>GraphicsProxy RenderState</title><link>http://blogs.msdn.com/virtualearth3d/archive/2009/09/22/graphicsproxy-renderstate.aspx</link><pubDate>Tue, 22 Sep 2009 23:03:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9898177</guid><dc:creator>NikolaiF</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/virtualearth3d/comments/9898177.aspx</comments><wfw:commentRss>http://blogs.msdn.com/virtualearth3d/commentrss.aspx?PostID=9898177</wfw:commentRss><description>&lt;P&gt;I've gotten a few questions lately about how to do some alpha effects using models, specifically MeshGraphicsObject.&amp;nbsp; After you create the GraphicsObject, it has a RenderState object available on it.&amp;nbsp; The fields on this object will be familiar to those experienced with DirectX, but here's a rundown of a few especially useful ones:&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Allow your model to cast shadows on the ground.&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newMesh.RenderState.Lighting.CastShadows = true;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Allow your model to have directional shading&lt;/U&gt; (you can adjust the direction of the light using Host.WorldEngine.Environment.SunPosition).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newMesh.RenderState.Lighting.DirectionalLightEnabled = true;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Allow your model to use transparency&lt;/U&gt;, whether from vertex colors, textures, or TextureFactor (see below).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newMesh.RenderState.Alpha.Enabled = true;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newMesh.RenderState.Alpha.SourceBlend = Blend.SourceAlpha;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newMesh.RenderState.Alpha.DestinationBlend = Blend.InvSourceAlpha;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Allow use of TextureFactor to control the overall color of the model&lt;/U&gt;.&amp;nbsp; For example, you can create a model that has a texture with a white patch, and then create two models, one red and one blue, both using the same texture but differing on the value of TextureFactor.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newMesh.RenderState.Stages[0].Blending.ColorArgument1 = TextureArgument.TextureColor;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newMesh.RenderState.Stages[0].Blending.ColorArgument2 = TextureArgument.TFactor;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newMesh.RenderState.Stages[0].Blending.ColorOperation = TextureOperation.Modulate;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Allow use of TextureFactor to control the overall opacity of the model&lt;/U&gt;.&amp;nbsp; This is great for fading effects, as changing the TextureFactor per-frame is cheap.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newMesh.RenderState.Stages[0].Blending.AlphaArgument1 = TextureArgument.TextureColor;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newMesh.RenderState.Stages[0].Blending.AlphaArgument2 = TextureArgument.TFactor;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newMesh.RenderState.Stages[0].Blending.AlphaOperation = TextureOperation.Modulate;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Change the filtering used for textures&lt;/U&gt;.&amp;nbsp; For example, in the XFile sample, if you zoom in close to the model the texture gets blocky.&amp;nbsp; Dropping this code in improves the situation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newMesh.RenderState.Stages[0].Sampler.MagnificationFilter = TextureFilter.Linear;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newMesh.RenderState.Stages[0].Sampler.MinificationFilter = TextureFilter.Linear;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;The TextureFactor value mentioned above&lt;/U&gt;.&amp;nbsp; This value would make the model ghostly transparent and red-tinged.&amp;nbsp; This (and other values in RenderState) can be cheaply changed every frame.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newMesh.RenderState.TextureFactor.Value = Color.FromArgb(128, Color.Red);&lt;/P&gt;
&lt;P&gt;One additional note:&amp;nbsp; to use alpha, you must also call AddAlphaRenderable in your actor's Render function instead of just AddRenderable.&amp;nbsp; The distance is a sorting function that lets the renderer know what order to draw the alpha in (affects blending).&amp;nbsp; A constant value works in some situations, but if you find things look wrong, especially when one of your models occludes another, try using a value based on the distance between the model and the camera.&lt;/P&gt;
&lt;P&gt;Here's a few shots to demonstrate the effects of these switches:&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH: 591px; HEIGHT: 533px" title="XFile Model" alt="XFile Model" src="http://www.veteam.members.winisp.net/Spaceland/blog/ModelOrig.jpg" width=591 height=533 mce_src="http://www.veteam.members.winisp.net/Spaceland/blog/ModelOrig.jpg"&gt;&lt;/P&gt;
&lt;P&gt;Everyone's favorite XFile sample model.&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH: 602px; HEIGHT: 544px" title="XFile Model, lit" alt="XFile Model, lit" src="http://www.veteam.members.winisp.net/Spaceland/blog/ModelLight.jpg" width=602 height=544 mce_src="http://www.veteam.members.winisp.net/Spaceland/blog/ModelLight.jpg"&gt;&lt;/P&gt;
&lt;P&gt;The same model, with shadows and directional lighting (the sun is above and a bit behind, if you move it the shading and shadows move appropriately).&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH: 612px; HEIGHT: 543px" title="XFile Model, alternate texture" alt="XFile Model, alternate texture" src="http://www.veteam.members.winisp.net/Spaceland/blog/ModelTex.jpg" width=612 height=543 mce_src="http://www.veteam.members.winisp.net/Spaceland/blog/ModelTex.jpg"&gt;&lt;/P&gt;
&lt;P&gt;The same again, with an alternate texture that contains transparency and the various alpha switches on.&amp;nbsp; Note one detail:&amp;nbsp; the shadow casting code does not account for transparency.&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH: 657px; HEIGHT: 631px" title="XFile model, all switches" alt="XFile model, all switches" src="http://www.veteam.members.winisp.net/Spaceland/blog/ModelAll.jpg" width=657 height=631 mce_src="http://www.veteam.members.winisp.net/Spaceland/blog/ModelAll.jpg"&gt;&lt;/P&gt;
&lt;P&gt;Same again, with all switches described above turned on.&amp;nbsp; The texture filtering is improved (look for blockiness in the center of the body in the previous shot), the color is shifted red, and the whole model is somewhat transparent, even parts where the texture is opaque.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9898177" 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/Rendering/default.aspx">Rendering</category></item><item><title>WMS Data</title><link>http://blogs.msdn.com/virtualearth3d/archive/2009/06/09/wms-data.aspx</link><pubDate>Tue, 09 Jun 2009 20:21:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9716735</guid><dc:creator>NikolaiF</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/virtualearth3d/comments/9716735.aspx</comments><wfw:commentRss>http://blogs.msdn.com/virtualearth3d/commentrss.aspx?PostID=9716735</wfw:commentRss><description>&lt;P&gt;I was having a discussion with&amp;nbsp;Kurt Guenther from &lt;A title="Infusion Surface Blog" href="http://www.infusion.com/surfaceblog/" target=_blank mce_href="http://www.infusion.com/surfaceblog/"&gt;Infusion&lt;/A&gt; yesterday on the topic of WMS servers and VE3D.&amp;nbsp; There is a large amount of very interesting spatial data out there served by &lt;A title="WMS on Wikipedia" href="http://en.wikipedia.org/wiki/Web_Map_Service" target=_blank mce_href="http://en.wikipedia.org/wiki/Web_Map_Service"&gt;Web Map Services&lt;/A&gt;, or WMS servers.&amp;nbsp; VE3D is able to process this data using ConnectionParameter-based DataSources.&amp;nbsp; Setting it up is pretty easy:&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: #2b91af; FONT-SIZE: 10pt"&gt;ConnectionParameters&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"&gt; cp = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;ConnectionParameters&lt;/SPAN&gt;(&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; 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;&lt;A href="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Portland/Portland_ESRI_Neighborhoods_AGO/MapServer/export?bbox=%7b16%7d,%7b17%7d,%7b18%7d,%7b19%7d&amp;amp;bboxSR=4326&amp;amp;layers=&amp;amp;layersDefs=&amp;amp;size=256,256&amp;amp;imageSR=102113&amp;amp;format=png&amp;amp;transparent=true&amp;amp;dpi=&amp;amp;f=image"&gt;&lt;FONT color=#0000ff&gt;http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Portland/Portland_ESRI_Neighborhoods_AGO/MapServer/export?bbox={16},{17},{18},{19}&amp;amp;bboxSR=4326&amp;amp;layers=&amp;amp;layersDefs=&amp;amp;size=256,256&amp;amp;imageSR=102113&amp;amp;format=png&amp;amp;transparent=true&amp;amp;dpi=&amp;amp;f=image&lt;/FONT&gt;&lt;/A&gt;&lt;/SPAN&gt;);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; connectionParameters = cp.ToString();&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #2b91af"&gt;DataSourceLayerData&lt;/SPAN&gt; layerData = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;DataSourceLayerData&lt;/SPAN&gt;(LayerName, Name, connectionParameters, &lt;SPAN style="COLOR: #2b91af"&gt;DataSourceUsage&lt;/SPAN&gt;.TextureMap);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Host.DataSources.Add(layerData);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Drop this in to your Activate (plug-in) or Initialized handler (winforms etc) app and fly to Portland, OR to see the data (thanks to ArcGIS for the sample data and Kurt for the pointer).&lt;/P&gt;
&lt;P mce_keep="true"&gt;I won't go into all the details of the WMS spec here, but I will call out a few important parts.&amp;nbsp; First, in order for this to work you must specify the bbox to be in Geographic coordinates (4326).&amp;nbsp; This is usually the default.&amp;nbsp; Second, you must pay attention to the returned projection.&amp;nbsp; In the above case, we have instructed the server to return 102113, which is Web Mercator, VE3D's native image projection.&amp;nbsp; This data can be consumed directly with very little overhead.&amp;nbsp; However, different servers support only certain formats and projections, and you must be careful for any particular server (it is possible to query this using WMS's GetCapabilities).&amp;nbsp; Nearly all support returning images in Geographic coordinates, 4326.&amp;nbsp; It is possible to instruct VE3D to reproject this to Web Mercator (this is the only reprojection VE3D will do for you, fortunately it will work for the majority of data).&lt;/P&gt;
&lt;P mce_keep="true"&gt;Now, to look at ConnectionParameters and what it can do for you.&amp;nbsp; First, there's the big url.&amp;nbsp; Notice that the bbox has string.Format replacement variables in it:&amp;nbsp; {16}, {17}, etc.&amp;nbsp; Requests to the server are made on a per-tile basis (the &lt;A title="Debug keys" href="http://blogs.msdn.com/virtualearth3d/archive/2008/10/29/debug-key-shortcuts.aspx" target=_blank mce_href="http://blogs.msdn.com/virtualearth3d/archive/2008/10/29/debug-key-shortcuts.aspx"&gt;T key&lt;/A&gt; is useful here).&amp;nbsp; For each request, these variables are replaced with data specific to the tile in question.&amp;nbsp; Here is a list of available parameters:&lt;/P&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;
&lt;P&gt;0 Reserved&lt;/P&gt;
&lt;P&gt;1 Map Style&lt;/P&gt;
&lt;P&gt;2 Round-robin integer&lt;/P&gt;
&lt;P&gt;3 Reserved&lt;/P&gt;
&lt;P&gt;4 Quadkey&lt;/P&gt;
&lt;P&gt;5 Extension&lt;/P&gt;
&lt;P&gt;6 Generation&lt;/P&gt;
&lt;P&gt;7 Stripe (0-3)&lt;/P&gt;
&lt;P&gt;8 Tile Host&lt;/P&gt;
&lt;P&gt;9 App Host&lt;/P&gt;
&lt;P&gt;10 Language code&lt;/P&gt;
&lt;P&gt;11 Region code&lt;/P&gt;
&lt;P&gt;12 Tile LOD&lt;/P&gt;
&lt;P&gt;13 Tile X&lt;/P&gt;
&lt;P&gt;14 Tile Y&lt;/P&gt;
&lt;P&gt;15 Low order stripe (0-1)&lt;/P&gt;
&lt;P&gt;16 MinLong&lt;/P&gt;
&lt;P&gt;17 MinLat&lt;/P&gt;
&lt;P&gt;18 MaxLong&lt;/P&gt;
&lt;P&gt;19 MaxLat&lt;/P&gt;
&lt;P&gt;20 RequestToken&lt;/P&gt;
&lt;P&gt;21 Culture name&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;P mce_keep="true"&gt;The most interesting ones are 4 (the main quad-key, very useful for already-tiled data), 12, 13, 14, and and 16-19.&amp;nbsp; To see some of this in action, check out the &lt;A title="Terrain Images live sample" href="http://www.veteam.members.winisp.net/Spaceland/Samplesv4/TerrainImages/TestPage.htm" target=_blank mce_href="http://www.veteam.members.winisp.net/Spaceland/Samplesv4/TerrainImages/TestPage.htm"&gt;TerrainImages sample&lt;/A&gt;&amp;nbsp;(also available in the &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 code&lt;/A&gt; of course).&amp;nbsp; Programatically, you can&amp;nbsp;investigate these values using the TileId class, using GetRequestCode, GetPosition, and GetLatLonBoundingBox.&lt;/P&gt;
&lt;P mce_keep="true"&gt;As for other values on ConnectionParameters, you can control reprojection (if your data is in Geographic, specify CoordinateReferenceSystem = WGS84CoordinateReferenceSystem.Instance, as noted before this is the only reprojection natively supported, so otherwise leave this field uninitialized), the bounds of where the data is valid is terms of Lat/Long and LOD (useful to reducing unnecessary network requests), and caching behavior.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Caching behavior deserves special discussion, because WMS servers are often quite slow.&amp;nbsp; By default, data loaded using ConnectionParameters is not cached locally.&amp;nbsp; Once it moves out of memory, it must be re-queried.&amp;nbsp; If you set CacheRetention however, the data will be kept locally for the period of time specified (unless it is evicted due to space restrictions in the interim).&amp;nbsp; If you set CacheRetention = new TimeSpan(24, 0, 0), for example, for 24 hours from the time of query a given tile will not be re-queried.&amp;nbsp; Note that some servers are dynamic, such as weather data, so it's important to use an appropriate value here.&lt;/P&gt;
&lt;P mce_keep="true"&gt;And just to give Kurt a poke in the ribs, please remember to only add DataSources after/during the Initialized event!&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;STRONG&gt;Update:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;John Fletcher from &lt;A href="http://www.latitudegeo.com/" target=_blank mce_href="http://www.latitudegeo.com/"&gt;Latitude Geographics&lt;/A&gt; pointed out that the example I give above isn't actually WMS compliant in its query parameters.&amp;nbsp; He suggests an alternate sample, of the British Columbia, CA&amp;nbsp;area:&lt;/P&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;
&lt;P&gt;ConnectionParameters&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; p = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;ConnectionParameters&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"http://openmaps.gov.bc.ca/mapserver/libcwms2?SERVICE=WMS&amp;amp;VERSION=1.1.1&amp;amp;REQUEST=GetMap&amp;amp;LAYERS=DBM_7H_MIL_BATHYMETRIC_POLY,BC_LABEL,DBM_7H_MIL_DRAINAGE_LINE,DBM_7H_MIL_DRAINAGE_POLY,DBM_7H_MIL_ROADS_LINE,DBM_7H_MIL_POLITICAL_POLY_PS,DBM_7H_MIL_POPULATION_POINT&amp;amp;STYLES=,,,,,,&amp;amp;SRS=EPSG:4326&amp;amp;BBOX={16},{17},{18},{19}&amp;amp;WIDTH=256&amp;amp;HEIGHT=256&amp;amp;FORMAT=image/png&amp;amp;TRANSPARENT=TRUE&amp;amp;EXCEPTIONS=application/vnd.ogc.se_inimage&amp;amp;"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;/P&gt;
&lt;P&gt;p.CoordinateReferenceSystem = Microsoft.MapPoint.CoordinateSystems.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;Wgs84CoordinateReferenceSystem&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.Instance;&lt;/P&gt;
&lt;P&gt;Host.DataSources.Add(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;DataSourceLayerData&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"foo"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"bar"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;, p.ToString(), &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;DataSourceUsage&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.TextureMap));&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;John&amp;nbsp;also provided a link to the WMS spec repository&amp;nbsp;(&lt;A href="http://www.opengeospatial.org/standards/wms"&gt;http://www.opengeospatial.org/standards/wms&lt;/A&gt;).&amp;nbsp; Note that the sample above is for WMS 1.1.1.&amp;nbsp; The most current version is 1.3.0, but many servers use the older, or support both.&amp;nbsp; No matter which you use (or even for something a little off spec like my original example) the interface with VE3D is the same.&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9716735" 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/DataSource/default.aspx">DataSource</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Cache/default.aspx">Cache</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/WMS/default.aspx">WMS</category></item><item><title>Manual Rendering</title><link>http://blogs.msdn.com/virtualearth3d/archive/2009/04/19/manual-rendering.aspx</link><pubDate>Sun, 19 Apr 2009 23:25:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9555894</guid><dc:creator>NikolaiF</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/virtualearth3d/comments/9555894.aspx</comments><wfw:commentRss>http://blogs.msdn.com/virtualearth3d/commentrss.aspx?PostID=9555894</wfw:commentRss><description>&lt;P&gt;Folks have really reacted to my mention of manual rendering, so I've made a sample for it.&amp;nbsp; Good thing, too, because to be frank there are a few warts.&amp;nbsp; On the upside, however, it is possible to work around all of them and the code required is not too scary.&lt;/P&gt;
&lt;P&gt;&lt;A class="" href="http://www.veteam.members.winisp.net/Spaceland/blog/ManualRender.zip" mce_href="http://www.veteam.members.winisp.net/Spaceland/blog/ManualRender.zip"&gt;Get the code!&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;In this sample, I host a GlobeControl on a form like normal, but instead of using the built-in render thread I render on the UI thread using the manual render API.&amp;nbsp; If you are content to let WinForms present to the screen for you, you're done at this point.&lt;/P&gt;
&lt;P&gt;But it is common in these situations to want to get the rendered surface to make a movie, present in some other context like WPF, etc.&amp;nbsp; I include an example of the most basic way to do this, which is the only official way to currently do it (WorldEngine.CaptureScreenShot).&amp;nbsp; If this isn't good enough, and you're a bit more daring, it is possible to get our rendering surface and do more clever things with it.&amp;nbsp; That's what the good folks at &lt;A class="" href="http://blogs.msdn.com/virtualearth3d/archive/2009/03/11/wpf-and-ve3d.aspx" mce_href="http://blogs.msdn.com/virtualearth3d/archive/2009/03/11/wpf-and-ve3d.aspx"&gt;Infostrat did for their WPF code&lt;/A&gt;, and for the time being I actually recommend using their wrapper if you want to use WPF.&lt;/P&gt;
&lt;P&gt;I've labelled all the warts and their workarounds with the tag "WORKAROUND" in the code so you can look more closely if you like, but you should also just be able to copy and paste the sample and get your code to work as it should.&amp;nbsp; Also, this is not actually an an official part of the sample pack, but something similar to it will be.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9555894" 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/Virtual+Earth+3D/default.aspx">Virtual Earth 3D</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Manual+Rendering/default.aspx">Manual Rendering</category></item><item><title>Anisotropic Filtering</title><link>http://blogs.msdn.com/virtualearth3d/archive/2009/04/19/anisotropic-filtering.aspx</link><pubDate>Sun, 19 Apr 2009 20:11:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9555803</guid><dc:creator>NikolaiF</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/virtualearth3d/comments/9555803.aspx</comments><wfw:commentRss>http://blogs.msdn.com/virtualearth3d/commentrss.aspx?PostID=9555803</wfw:commentRss><description>&lt;P&gt;Anisotropic has been a bit of a frustration for us because while it is&amp;nbsp;very easy to do (it's really just a flag to DirectX), the compatibility issue I mentioned before made it a pain to actually get it in to the control.&amp;nbsp; It's a shame we couldn't turn it on by default, but at least it's there.&amp;nbsp; The effect of it is really quite dramatic, as you can see below.&amp;nbsp; I took these images at &lt;A class="" href="http://maps.live.com/default.aspx?v=2&amp;amp;FORM=LMLTCC&amp;amp;cp=47.580449~-122.174841&amp;amp;style=a&amp;amp;lvl=19&amp;amp;tilt=-5.7760339183176&amp;amp;dir=264.32567009971&amp;amp;alt=50.7784003261477&amp;amp;cam=47.580592~-122.172705&amp;amp;scene=-1&amp;amp;phx=0&amp;amp;phy=0&amp;amp;phscl=1&amp;amp;encType=1" target=_blank mce_href="http://maps.live.com/default.aspx?v=2&amp;amp;FORM=LMLTCC&amp;amp;cp=47.580449~-122.174841&amp;amp;style=a&amp;amp;lvl=19&amp;amp;tilt=-5.7760339183176&amp;amp;dir=264.32567009971&amp;amp;alt=50.7784003261477&amp;amp;cam=47.580592~-122.172705&amp;amp;scene=-1&amp;amp;phx=0&amp;amp;phy=0&amp;amp;phscl=1&amp;amp;encType=1"&gt;this location&lt;/A&gt;, near the 405 and 90 interchange in Bellevue.&lt;/P&gt;
&lt;P&gt;With anisotropic filtering enabled:&lt;/P&gt;
&lt;P&gt;&lt;IMG title="Anisotropic filtering" style="WIDTH: 632px; HEIGHT: 558px" height=558 alt="Anisotropic filtering" src="http://www.veteam.members.winisp.net/Spaceland/blog/aniso.jpg" width=632 mce_src="http://www.veteam.members.winisp.net/Spaceland/blog/aniso.jpg"&gt;&lt;/P&gt;
&lt;P&gt;Without:&lt;/P&gt;
&lt;P&gt;&lt;IMG title="Trilinear Filtering" style="WIDTH: 631px; HEIGHT: 554px" height=554 alt="Trilinear Filtering" src="http://www.veteam.members.winisp.net/Spaceland/blog/nonaniso.jpg" width=631 mce_src="http://www.veteam.members.winisp.net/Spaceland/blog/nonaniso.jpg"&gt;&lt;/P&gt;
&lt;P&gt;To turn it on in the website, click "options" in the upper right corner, then "3D settings", and finally check "Use anisotropic filtering".&amp;nbsp; To turn it on in code:&lt;/P&gt;&lt;FONT size=2&gt;
&lt;P&gt;plugIn.Host.RenderEngine.Graphics.Settings.UseAnisotropicFiltering = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;true&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;These settings are remembered in the user.config file for future runs of the control.&amp;nbsp; The perf penalty for this on cards that are even remotely modern is almost zero, so go turn it on now!&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9555803" 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/Virtual+Earth+3D/default.aspx">Virtual Earth 3D</category></item><item><title>New Version Released!</title><link>http://blogs.msdn.com/virtualearth3d/archive/2009/04/09/new-version-released.aspx</link><pubDate>Fri, 10 Apr 2009 01:46:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9541704</guid><dc:creator>NikolaiF</dc:creator><slash:comments>13</slash:comments><comments>http://blogs.msdn.com/virtualearth3d/comments/9541704.aspx</comments><wfw:commentRss>http://blogs.msdn.com/virtualearth3d/commentrss.aspx?PostID=9541704</wfw:commentRss><description>&lt;P&gt;Our new version has gone live.&amp;nbsp; Head on over to &lt;A class="" href="http://maps.live.com/" target=_blank mce_href="http://maps.live.com/"&gt;maps.live.com&lt;/A&gt; and click "3D" to upgrade.&amp;nbsp; This release is billed primarily as a perf and bug release because it doesn't add a lot of new features at the end-user level (though I think you will be pleased with the perf improvements), but we did have time to throw in some good stuff for the devs.&lt;/P&gt;
&lt;P&gt;I've updated the Samples entry, and clicking on the link should get you the new sample set.&amp;nbsp; As usual, please pass along any problems in comments or blog feedback.&amp;nbsp; The samples are mostly the same, with a few new additions, but they have been cleaned up for best practices and new features.&amp;nbsp; I do recommend that you take a glance at them even if you're already familiar with the API.&amp;nbsp; The Camera sample is most changed, and hopefully should help explain the flow of camera control a little better.&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;P&gt;Here's a sampling of new and expanded areas:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Initialized event&lt;/STRONG&gt;&lt;BR&gt;&amp;nbsp;A new event on RenderEngine that simplifies the startup scenario.&amp;nbsp; Check out SimpleForm to see it.&amp;nbsp; Remember that use of this event or FirstFrameRendered is now required!&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Anisotropic Filtering&lt;/STRONG&gt;&lt;BR&gt;&amp;nbsp;Greatly improves the appearance of terrain when at an angle.&amp;nbsp; It's off by default, since there are some graphics cards that don't play nice with it (usually old and rare, but still).&amp;nbsp; You can turn this on through the website in the options box, or you can set it programmatically.&amp;nbsp; See SimpleForm.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Dem Data&lt;/STRONG&gt;&lt;BR&gt;&amp;nbsp;The ability to supply custom DEM data, and have it automatically stitched into existing data.&amp;nbsp; Previously DEM datasources did not work very well, mostly because we did not automatically stitch.&amp;nbsp; They are still a bit trickier than imagery, but there's a new sample DemData to help you out.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;ILocationListener&lt;/STRONG&gt;&lt;BR&gt;&amp;nbsp;An interface that allows automatic and efficient query of a location to determine elevation as data changes.&amp;nbsp; ActorDataSource now uses it.&amp;nbsp; Essentially, you register this object and report its Lat/Lon position.&amp;nbsp; If the ground or other solid object moves or changes there, you will get a call to update.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Manual Rendering&lt;/STRONG&gt;&lt;BR&gt;&amp;nbsp;Manual render functions that allow use your own thread as the render thread, good for offline rendering or incorporation into another product.&amp;nbsp; RenderEngine.ManuallyInitializeRender and ManuallyRenderNextFrame.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Datasource ConnectionParameters&lt;/STRONG&gt;&lt;BR&gt;&amp;nbsp;Helper function for specifying data sources without a content manifest.&amp;nbsp; The string parameter was very hard to use, this is nicer.&amp;nbsp; There are also a few new options, like allowing caching of data specified this way.&amp;nbsp; See TerrainImages.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;CelestialStyle&lt;/STRONG&gt;&lt;BR&gt;&amp;nbsp;Allow display of a stylized sky with constellations.&amp;nbsp; This is used on the website in Road Mode, but you can set it yourself.&amp;nbsp; See SimpleForm.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Versioning&lt;BR&gt;&lt;/STRONG&gt;&amp;nbsp;Support for running code built against previous control versions, if it meets certain requirements.&amp;nbsp; I've outlined this in &lt;A href="http://blogs.msdn.com/virtualearth3d/archive/2009/04/01/upcoming-new-version.aspx"&gt;http://blogs.msdn.com/virtualearth3d/archive/2009/04/01/upcoming-new-version.aspx&lt;/A&gt;.&amp;nbsp; To show it working, I've set up a page with samples built from the &lt;A class="" href="http://www.veteam.members.winisp.net/Spaceland/Samples/TestPage.htm" target=_blank mce_href="http://www.veteam.members.winisp.net/Spaceland/Samples/TestPage.htm"&gt;previous version&lt;/A&gt;&amp;nbsp;and from the &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;new version&lt;/A&gt;.&amp;nbsp; Both sets work just fine with the new release.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Pixel-width lines&lt;/STRONG&gt;&lt;BR&gt;&amp;nbsp;GeometryManager supports pixel-width 3D lines (previously only single-pixel or meter-width).&amp;nbsp; See the Camera sample.&amp;nbsp; We also now have nice looking text labels.&amp;nbsp; See the XFile sample.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Constant value datasources&lt;/STRONG&gt;&lt;BR&gt;&amp;nbsp;Helper functions for supplying flat color or elevation data.&amp;nbsp; The Mandelbrot sample uses one to display flat elevation.&amp;nbsp; Please note that a DEM and an Imagery datasource are actually required for proper display.&amp;nbsp; These constant value sources are useful for this case.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Terrain Scaling&lt;/STRONG&gt;&lt;BR&gt;&amp;nbsp;WorldEngine.Min/MaxElevationScaling.&amp;nbsp; It is actually possible to have varying scale based on your altitude, but there is some cost associated and I recommend that you set the two values equal to each other.&amp;nbsp; Our default value is 1.0, unscaled.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Override Loading Screen&lt;BR&gt;&lt;/STRONG&gt;&amp;nbsp;You can now render (or suppress) the loading screen (affectionately known as "The Circle Of Hope" since our first version, back when the startup flow was a bit less stable than it is now).&amp;nbsp; In the very simplest case, write this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;class MyControl : GlobeControl&lt;BR&gt;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; protected override void OnPaintLoading(...)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;}&lt;/P&gt;
&lt;P&gt;This will get you a black screen.&amp;nbsp; You can also grab a reference to the control's Graphics object from the PaintEventArgs and draw anything you like.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Building culling value&lt;/STRONG&gt;&lt;BR&gt;&amp;nbsp;Allows control of how many buildings are displayed, based on distance and size of the buildings.&amp;nbsp; WorldEngine.BuildingCulling.&amp;nbsp; The effectiveness of this varies on hardware -- some hardware benefits a great deal, some very little.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Turn on/off street level navigation&lt;BR&gt;&lt;/STRONG&gt;&amp;nbsp;Can turn off some of the special navigation effects that occur when right next to the ground, such as sticking to the ground, and the screen drag regions on the sides of the screen when at low altitude.&amp;nbsp; WorldEngine.Enable*.&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;We have not yet updated the docs.&amp;nbsp; However, we did not make many fundamental changes to the code from an API perspective, and in fact existing code is as much as possible exactly the same.&amp;nbsp; So it is just lacking detail on the new features, and still a good reference.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9541704" 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/Documentation/default.aspx">Documentation</category></item><item><title>Logging</title><link>http://blogs.msdn.com/virtualearth3d/archive/2009/04/05/logging.aspx</link><pubDate>Mon, 06 Apr 2009 00:21:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9532481</guid><dc:creator>NikolaiF</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/virtualearth3d/comments/9532481.aspx</comments><wfw:commentRss>http://blogs.msdn.com/virtualearth3d/commentrss.aspx?PostID=9532481</wfw:commentRss><description>&lt;P&gt;At times it can be useful to know when and if errors are occurring in VE3D.&amp;nbsp; When instructed, VE3D produces a log file that can be helpful for diagnosis.&amp;nbsp; This requires editing the user.config file and adding an entry:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;setting name="Logging" serializeAs="String"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;value&amp;gt;True&amp;lt;/value&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/setting&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;The user.config file is located at:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;(Vista) C:\Users\{username}\AppData\LocalLow\Microsoft\Virtual Earth 3D&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;(XP) C:\Documents and Settings\{username}\Application Data\Microsoft\Virtual Earth 3D&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Log files are generated at:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;(Vista) C:\Users\{username}\AppData\LocalLow\Microsoft\Virtual Earth 3D&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;(XP) C:\Documents and Settings\{username}\Local Settings\Application Data\Microsoft\Virtual Earth 3D&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;To increase the verbosity of logs, add another entry to user.config:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;setting name="LoggingLevel" serializeAs="String"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;value&amp;gt;2&amp;lt;/value&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/setting&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The values are like so:&lt;/P&gt;
&lt;P&gt;0:&amp;nbsp; Critical errors only.&amp;nbsp; These errors may affect users.&lt;BR&gt;1:&amp;nbsp; Warnings only.&amp;nbsp; These are errors that are handled internally and should not affect users.&lt;BR&gt;2:&amp;nbsp; Informational.&amp;nbsp; These are not errors, but can be useful in some cases for debugging.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9532481" 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/Virtual+Earth+3D/default.aspx">Virtual Earth 3D</category></item><item><title>Information Pop-ups in WinForms</title><link>http://blogs.msdn.com/virtualearth3d/archive/2008/11/24/information-pop-ups-in-winforms.aspx</link><pubDate>Tue, 25 Nov 2008 00:47:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9139174</guid><dc:creator>NikolaiF</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/virtualearth3d/comments/9139174.aspx</comments><wfw:commentRss>http://blogs.msdn.com/virtualearth3d/commentrss.aspx?PostID=9139174</wfw:commentRss><description>&lt;P&gt;We've had several questions about how to do a pop-up form in WinForms, similar to the one on the website.&amp;nbsp; The website pop-up is implemented entirely within the browser, using an IFrame.&amp;nbsp; Therefore, the functionality does not exist by default in the managed code alone.&amp;nbsp; However, the events you need are provided, and creating your own pop-up is not difficult.&lt;/P&gt;
&lt;P&gt;&lt;IMG title="Html rendered pop-up" style="WIDTH: 603px; HEIGHT: 510px" height=510 alt="Html rendered pop-up" src="http://www.veteam.members.winisp.net/Spaceland/blog/html.jpg" width=603 mce_src="http://www.veteam.members.winisp.net/Spaceland/blog/html.jpg"&gt;&lt;/P&gt;
&lt;P&gt;The event you need is EngineEvents.OnHover, accessed via the CommunicationManager.&amp;nbsp; It will fire when the mouse hovers over any GeometryManager object that has hit detection on.&amp;nbsp; The event arguments (CommunicationParameters) tell you which item was hovered and where on the screen it is.&amp;nbsp; I used the Tag property on WorldGeometry to hold the name and description I wish to display, so when I get the hover event I retrieve the item back again and pass the tag to my Popup form.&lt;/P&gt;
&lt;P&gt;The next step is to render the form.&amp;nbsp; There are two behaviors we want:&amp;nbsp; first, the auto-closing.&amp;nbsp; This was pretty simple to do using a Timer.&amp;nbsp; When you get an OnHoverEnd (another EngineEvent), start a timer.&amp;nbsp; If the mouse moves into the popup, stop the timer.&amp;nbsp; When the mouse leaves it, start the timer again.&amp;nbsp; The second behavior is rendering HTML.&amp;nbsp; This was trivial on the website, but a little tricker in winforms.&amp;nbsp; Fortunately Windows ships with mshtml, which has a ready-made browser window.&amp;nbsp; I based my work on &lt;A class="" href="http://blog.monstuff.com/archives/000052.html" target=_blank mce_href="http://blog.monstuff.com/archives/000052.html"&gt;this&lt;/A&gt;, and had it working in just a few minutes.&lt;/P&gt;
&lt;P&gt;I'm certain all of this could be done more attractively and elegantly, but it should get you started.&amp;nbsp; I updated the main samples package to have the new HtmlForm project.&amp;nbsp; Just grab the zip file again and pull out that project directory.&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;P&gt;P.S.&amp;nbsp; If you want to open an ERO from a plug-in without having to go through the JS API first, do this:&lt;/P&gt;&lt;FONT size=2&gt;
&lt;P&gt;CommunicationParameterSet set = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; CommunicationParameterSet(8);&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;set.Add(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"layerId"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;null&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;BR&gt;set.Add(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"pushpinId"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;null&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;BR&gt;set.Add(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"rX1"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;, p.X);&lt;BR&gt;set.Add(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"rY1"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;, p.Y);&lt;BR&gt;set.Add(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"rX2"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;, p.X);&lt;BR&gt;set.Add(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"rY2"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;, p.Y);&lt;BR&gt;set.Add(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"header"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;, name);&lt;BR&gt;set.Add(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"content"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;, desc == &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;null&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; ? &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;string&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.Empty : desc);&lt;BR&gt;Host.CommunicationManager.FireEvent(EngineEvents.Group, EngineEvents.OnHover, set);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;p is the location on the screen you want it, name is the title, and desc is your html content.&lt;/P&gt;&lt;/FONT&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9139174" 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/Windows+Forms/default.aspx">Windows Forms</category></item><item><title>Animated Textures</title><link>http://blogs.msdn.com/virtualearth3d/archive/2008/11/19/animated-textures.aspx</link><pubDate>Wed, 19 Nov 2008 03:55:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9121187</guid><dc:creator>NikolaiF</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/virtualearth3d/comments/9121187.aspx</comments><wfw:commentRss>http://blogs.msdn.com/virtualearth3d/commentrss.aspx?PostID=9121187</wfw:commentRss><description>&lt;P&gt;In addition to using dynamic buffers to animate geometry, you can also animate the textures on geometry.&amp;nbsp; This is accomplished by using BitmapProvider.&amp;nbsp; A BitmapProvider at its simplest is just a wrapper for a Bitmap, which can be used as the icon for a pushpin or the data for a texture that should be applied to geometry that you create in an Actor.&amp;nbsp; In fact, if you just have&amp;nbsp;a single image you can use SingleBitmapProvider.&amp;nbsp; You expose this Bitmap via the CurrentImage property.&amp;nbsp; You also have to provide the size of the image upfront using ImageSize.&amp;nbsp; If you want to change the texture, the system polls the NewImageAvailable property.&amp;nbsp; If you return true, the system re-reads CurrentImage and copies data into the display texture.&amp;nbsp; When it is done, it calls OperationCompleted.&lt;/P&gt;
&lt;P&gt;&lt;A class="" title="Animated pin" href="http://www.veteam.members.winisp.net/Spaceland/Samples/AnimatedPins/TestPage.htm" mce_href="http://www.veteam.members.winisp.net/Spaceland/Samples/AnimatedPins/TestPage.htm"&gt;&lt;IMG title="Animated pin" style="WIDTH: 673px; HEIGHT: 560px" height=560 alt="Animated pin" src="http://www.veteam.members.winisp.net/Spaceland/Samples/AnimatedPins/sample.jpg" width=673 mce_src="http://www.veteam.members.winisp.net/Spaceland/Samples/AnimatedPins/sample.jpg"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A class="" title="Animated pin" href="http://www.veteam.members.winisp.net/Spaceland/Samples/AnimatedPins/TestPage.htm" target=_blank mce_href="http://www.veteam.members.winisp.net/Spaceland/Samples/AnimatedPins/TestPage.htm"&gt;See it in action!&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;In this sample, we use a pushpin created with our own BitmapProvider.&amp;nbsp; This provider reads the&amp;nbsp;previous screen buffer, creating an infinite mirror effect.&amp;nbsp; We could actually clean this sample up a bit in two ways:&amp;nbsp;by implementing HasFrequentUpdates to return true (causing it to animate continuously) and removing the call to Host.NeedUpdate, and by implementing OperationCompleted to dispose current.&lt;/P&gt;
&lt;P&gt;In a more realistic example, we might have a thread that periodically queries the url of a traffic cam.&amp;nbsp; When the image data arrives, set NewImageAvailable to true, provide the new image, and in OperationCompleted signal the query thread to get a new image.&lt;/P&gt;
&lt;P&gt;For a demonstration of how to do this using Actors, copy the ScreenshotProvider class from AnimatedPins to BezierSurface, and change SurfacePlugIn.cs, line 91, to:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Texture t = Texture.FromBitmapProvider(new ScreenshotProvider(this.Host));&lt;/P&gt;
&lt;P&gt;and presto! you get the same effect.&lt;/P&gt;
&lt;P&gt;Finally, SingleImageProvider has code built in to deal with animated gifs.&amp;nbsp; Simply create a bitmap with the animated gif,&amp;nbsp;hand it to SingleImageProvider, that to your pin or&amp;nbsp;Texture,&amp;nbsp;and everything should go on its own from there.&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=9121187" 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/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>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>New Version of VE3D</title><link>http://blogs.msdn.com/virtualearth3d/archive/2008/09/25/new-version-of-ve3d.aspx</link><pubDate>Thu, 25 Sep 2008 20:03:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8965277</guid><dc:creator>NikolaiF</dc:creator><slash:comments>17</slash:comments><comments>http://blogs.msdn.com/virtualearth3d/comments/8965277.aspx</comments><wfw:commentRss>http://blogs.msdn.com/virtualearth3d/commentrss.aspx?PostID=8965277</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;You may have noticed that we have not blogged recently, and that’s because we’ve been hard at work on the next version of Virtual Earth 3D.&amp;nbsp; The new version features some rendering improvements for the general user, but the most exciting part is for devs (well, that's what we think, but we ARE devs). &amp;nbsp;We have enabled partial trust plug-ins, which means you can put your plug-in on the web, create a page that references it, and users can go see it without having to install anything more than the basic VE3D control.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;Behind the scenes, we load your plug-in’s dll to the client and execute it with a limited set of permissions.&amp;nbsp; For example, the plug-in cannot access the file system on its own, but you can still do custom rendering and control like you could before.&amp;nbsp; We’ve updated all the samples you’ve seen so far to run like this, except for the x file loader and the shortcut key (which was an example of how to install one, and is still a valid scenario in some cases).&amp;nbsp; We’ve also added a few new samples to show some new functionality and demonstrate some stuff that’s been there for awhile but we hadn’t gotten a chance to show yet.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;Existing code built against VE3D will need to be recompiled, and in some cases we’ve moved a few properties around.&amp;nbsp; The samples should cover most of these changes, but please comment or send us feedback on items that you have trouble with.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;&lt;A class="" href="http://maps.live.com/" mce_href="http://maps.live.com/"&gt;Get the new version!&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&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 new samples!&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8965277" 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/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>New Intellisense Files</title><link>http://blogs.msdn.com/virtualearth3d/archive/2008/07/08/new-intellisense-files.aspx</link><pubDate>Wed, 09 Jul 2008 00:18:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8709852</guid><dc:creator>NikolaiF</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/virtualearth3d/comments/8709852.aspx</comments><wfw:commentRss>http://blogs.msdn.com/virtualearth3d/commentrss.aspx?PostID=8709852</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;Some entries were missing or incomplete from the xml intellisense files in the samples zip in the &lt;A class="" href="http://blogs.msdn.com/virtualearth3d/archive/2008/04/11/adding-a-virtual-earth-3d-plug-in-to-your-webpage.aspx" mce_href="http://blogs.msdn.com/virtualearth3d/archive/2008/04/11/adding-a-virtual-earth-3d-plug-in-to-your-webpage.aspx"&gt;first post&lt;/A&gt; of this blog.&amp;nbsp; I've posted a zip of the &lt;A class="" href="http://auldane.members.winisp.net/msdn/Intellisense.zip" mce_href="http://auldane.members.winisp.net/msdn/Intellisense.zip"&gt;new xml files&lt;/A&gt;, and updated the &lt;A class="" href="http://auldane.members.winisp.net/msdn/Samples.zip" mce_href="http://auldane.members.winisp.net/msdn/Samples.zip"&gt;samples zip&lt;/A&gt;&amp;nbsp;itself.&amp;nbsp; Just unzip the file and drop the new xml files in Program Files/Virtual Earth 3D.&amp;nbsp; You'll need to restart Visual Studio to see them.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8709852" 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/Virtual+Earth+3D/default.aspx">Virtual Earth 3D</category></item></channel></rss>