<?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 : Animation</title><link>http://blogs.msdn.com/virtualearth3d/archive/tags/Animation/default.aspx</link><description>Tags: Animation</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><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>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></channel></rss>