<?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>Windows Presentation Foundation-3D Musings : 3D</title><link>http://blogs.msdn.com/pantal/archive/tags/3D/default.aspx</link><description>Tags: 3D</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>How to Draw WPF 3D Wireframe Graphics</title><link>http://blogs.msdn.com/pantal/archive/2008/12/16/how-to-draw-wpf-3d-wireframe-graphics.aspx</link><pubDate>Wed, 17 Dec 2008 02:23:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9229066</guid><dc:creator>pantal</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/pantal/comments/9229066.aspx</comments><wfw:commentRss>http://blogs.msdn.com/pantal/commentrss.aspx?PostID=9229066</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&amp;nbsp;A question I periodically see on forums and discussions with WPF 3D graphics users is, "how do I draw wireframe" content for 3D.&amp;nbsp;This isn't supported out of the box, but&amp;nbsp;couple strategies I would suggest are:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;The out of band 3DTools library from members of the WPF 3D team includes "ScreenSpaceLines" which allows for wireframe rendering of lines. &lt;/SPAN&gt;&lt;SPAN style="mso-fareast-font-family: 'Times New Roman'"&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;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;A href="http://www.codeplex.com/3DTools"&gt;&lt;FONT color=#0000ff&gt;http://www.codeplex.com/3DTools&lt;/FONT&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-fareast-font-family: 'Times New Roman'"&gt;&lt;FONT size=3&gt;&lt;FONT face="Times New Roman"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Charles Petzold has also posted about wireframe rendering with his own implementation.&lt;/SPAN&gt;&lt;SPAN style="mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;A href="http://www.charlespetzold.com/blog/2007/08/310158.html"&gt;&lt;FONT color=#0000ff&gt;http://www.charlespetzold.com/blog/2007/08/310158.html&lt;/FONT&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9229066" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/pantal/archive/tags/WPF/default.aspx">WPF</category><category domain="http://blogs.msdn.com/pantal/archive/tags/3D/default.aspx">3D</category></item><item><title>XAML 3D Tools &amp; Tech</title><link>http://blogs.msdn.com/pantal/archive/2008/01/17/xaml-3d-tools-tech.aspx</link><pubDate>Thu, 17 Jan 2008 04:53:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7138675</guid><dc:creator>pantal</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/pantal/comments/7138675.aspx</comments><wfw:commentRss>http://blogs.msdn.com/pantal/commentrss.aspx?PostID=7138675</wfw:commentRss><description>&lt;P&gt;I periodically run into queries&amp;nbsp;for &amp;nbsp;tools for modelling 3D content for use with XAML. Here are some notable resources to consider:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;A class="" href="http://codeplex.com/xamlexporter" mce_href="http://codeplex.com/xamlexporter"&gt;Xaml Exporter for Blender&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A class="" href="http://www.erain.com/Products/ZAM3D/" mce_href="http://www.erain.com/Products/ZAM3D/"&gt;Zam3D Modeller&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A class="" href="http://www.highend3d.com/maya/downloads/tools/3d_converters/3782.html" mce_href="http://www.highend3d.com/maya/downloads/tools/3d_converters/3782.html"&gt;Maya to XAML converter&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A class="" href="http://www.wpf-graphics.com/Viewer3ds.aspx" mce_href="http://www.wpf-graphics.com/Viewer3ds.aspx"&gt;Viewer 3DS &lt;/A&gt;3DS to XAML Converter&lt;/LI&gt;
&lt;LI&gt;OBJ to XAML support in &lt;A class="" href="http://www.microsoft.com/expression/" mce_href="http://www.microsoft.com/expression/"&gt;Expression Blend&lt;/A&gt;&amp;nbsp;(&lt;A class="" href="http://blogs.msdn.com/expression/archive/2007/12/18/mini-cube-ready-for-developers-can-you-finish-it.aspx" mce_href="http://blogs.msdn.com/expression/archive/2007/12/18/mini-cube-ready-for-developers-can-you-finish-it.aspx"&gt;Mini Cube&lt;/A&gt; Walkthrough)&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;In addition, there are a number of libraries for generating 3D primitive content such as planes, spheres, cubes, etc in circulation on various community sites.&amp;nbsp;Creating a 3D content library is a good way to test your knowledge of 3D, but if re-inventing the wheel isn't your thing,&amp;nbsp;Charles Petzold has scoped out some quality content in this space:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;MSDN &lt;A class="" href="http://msdn.microsoft.com/msdnmag/issues/07/10/Foundations/default.aspx" mce_href="http://msdn.microsoft.com/msdnmag/issues/07/10/Foundations/default.aspx"&gt;3D Text Tutorial&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A class="" href="http://www.charlespetzold.com/3D/" mce_href="http://www.charlespetzold.com/3D/"&gt;Petzold.Media3D&lt;/A&gt;&amp;nbsp;library complementing his WPF 3D book&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;I would recommend getting conversant with using both modelling tools and generating content via code. Some cursory considerations to ponder when considering how to represent 3D content:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Ease of Representation -&amp;nbsp;If you&amp;nbsp;want to&amp;nbsp;represent a bunch of cubes/spheres with different textures in each case, you'd probably be crazy to try&amp;nbsp;create and texture those separately in a modelling tool.&amp;nbsp;Likewise, representing shapes from the naturual world, like&amp;nbsp;animals, from primitive 3D shapes could quickly get to be painful.&lt;/LI&gt;
&lt;LI&gt;Binary/Data file size - For instance,&amp;nbsp;a high resolution sphere can be represented on disk much more cheaply with the algorithm, than the corresponding mesh.&lt;/LI&gt;
&lt;LI&gt;Load time - Trade-off of disk time vs potentially non-trivial generating algorithms&lt;/LI&gt;
&lt;LI&gt;Texturing - Which approach allows you to texture your content satisfactorily - Can you&amp;nbsp;represent multiple material "layers" in an effective way,&amp;nbsp;do you want to utilize techniques such as level of detail rendering, etc... Specialized 3D tools are targeted to the work of "skinnning" the texture coordinates complex models.&lt;/LI&gt;
&lt;LI&gt;Flexibility - For instance, if you want to do techniques such as "Level of Detail" rendering, a generated content approach can provide you more flexibility than modelled content. Modellers/Artists *love* it when you ask them to turn their 300k poly masterpiece into 80 triangles. This usually translates to running mesh simplification tools on existing models, or just hack out some workflow tool to perform that work in batches, followed by some fine tuning at the end. In this context, generating the appropriate mesh complexity at run time is preferable to at design time.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;I'm happy to hear from customers working on their WPF apps! Let me know if you have any questions, feedback or comments. Thanks!&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7138675" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/pantal/archive/tags/WPF/default.aspx">WPF</category><category domain="http://blogs.msdn.com/pantal/archive/tags/3D/default.aspx">3D</category><category domain="http://blogs.msdn.com/pantal/archive/tags/XAML/default.aspx">XAML</category><category domain="http://blogs.msdn.com/pantal/archive/tags/Modeller/default.aspx">Modeller</category></item><item><title>UIElement3D extensibility - 3D Video Carousel</title><link>http://blogs.msdn.com/pantal/archive/2007/08/22/uielement3d-extensibility-dvd-keep-case-player-cylindrical-carousel-layout.aspx</link><pubDate>Wed, 22 Aug 2007 05:45:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4503093</guid><dc:creator>pantal</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/pantal/comments/4503093.aspx</comments><wfw:commentRss>http://blogs.msdn.com/pantal/commentrss.aspx?PostID=4503093</wfw:commentRss><description>&lt;P&gt;Recently I've been working on a screencast, which goes over some advanced aspects of working with Element3D. In the meantime, this sample demonstrates WPF's Orcas Beta 2 UIElement 3D technology, covering the essentials for how you can make your own reusable UIElement3D controls for 3D. I have two in here: &lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;A&amp;nbsp;"KeepCaseUIElement3D", a&amp;nbsp;representation of a real world DVD case,&amp;nbsp;with the added twist of&amp;nbsp;playing video on the inside. It's&amp;nbsp;API consumes Uri's for cover images and a media source, rather than traditional models, meshes, and materials in 3D&amp;nbsp;.&lt;/LI&gt;
&lt;LI&gt;A "MovieCarousel" - a simple 3D carousel layout control which re-orients itself to position the object which was last clicked towards the user.&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;You will need to operate with the WPF V3.5(Orcas) Beta 2 Bits. You can get the Visual Studio Orcas Beta 2&amp;nbsp;installation with WPF from &lt;A class="" href="http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx" mce_href="http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&lt;IMG title="A set of streaming WPF tutorial Videos " style="WIDTH: 600px; HEIGHT: 500px" height=500 alt="A set of streaming WPF tutorial Videos " src="http://blogs.msdn.com/photos/pantal/images/4502918/original.aspx" width=600 mce_src="http://blogs.msdn.com/photos/pantal/images/4502918/original.aspx"&gt;&lt;/P&gt;
&lt;P&gt;Concepts you&amp;nbsp;can see in practice with this sample include:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Creating interactive 3D controls as interactive containers on non-interactive 3D models (Hint - Leverage existing 3D Xaml with little effort)&lt;/LI&gt;
&lt;LI&gt;Creating a Custom Visual3D container type&lt;/LI&gt;
&lt;LI&gt;Use of StaticResources from Application.Resources to separate mesh details from overall structure&lt;/LI&gt;
&lt;LI&gt;Databinding a mesh texture to consume a local DP exposed as a URI, via a data binding type converter&lt;/LI&gt;
&lt;LI&gt;3D Layout - Cylinder Layout Helper class&lt;/LI&gt;
&lt;LI&gt;Playing Video as a material on 3D&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;If you have any questions on the details of this sample, feel free to send me a message, or leave a relevant comment- odds are fair other folks have similar questions, which could make for interesting future blog postings! &lt;/P&gt;
&lt;P&gt;&amp;nbsp;Thanks!&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4503093" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/pantal/attachment/4503093.ashx" length="644001" type="application/x-zip-compressed" /><category domain="http://blogs.msdn.com/pantal/archive/tags/UIElement3D/default.aspx">UIElement3D</category><category domain="http://blogs.msdn.com/pantal/archive/tags/3D/default.aspx">3D</category><category domain="http://blogs.msdn.com/pantal/archive/tags/Orcas/default.aspx">Orcas</category><category domain="http://blogs.msdn.com/pantal/archive/tags/V3.5/default.aspx">V3.5</category><category domain="http://blogs.msdn.com/pantal/archive/tags/3D+Layout/default.aspx">3D Layout</category><category domain="http://blogs.msdn.com/pantal/archive/tags/Video+on+3D/default.aspx">Video on 3D</category></item><item><title>Details on the 3D Earth Rendering Sample</title><link>http://blogs.msdn.com/pantal/archive/2007/08/03/details-on-the-3d-earth-rendering-sample.aspx</link><pubDate>Fri, 03 Aug 2007 04:31:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4197228</guid><dc:creator>pantal</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/pantal/comments/4197228.aspx</comments><wfw:commentRss>http://blogs.msdn.com/pantal/commentrss.aspx?PostID=4197228</wfw:commentRss><description>&lt;P&gt;Yesterday I posted a some &lt;A class="" href="http://blogs.msdn.com/pantal/archive/2007/08/02/combined-materials-for-interesting-3d-planet-renderings-in-wpf.aspx" mce_href="http://blogs.msdn.com/pantal/archive/2007/08/02/combined-materials-for-interesting-3d-planet-renderings-in-wpf.aspx"&gt;screenshots&lt;/A&gt; of a 3D earth sample involving a mix of materials to achieve interesting visual effects. &lt;/P&gt;
&lt;P&gt;Attached is the sample application(Requires&amp;nbsp;V3.5 to run), and the essential core source code, which can be placed in a new WPF project, in conjunction with a set of suitable textures. It is built to run on WPF V3.5 as it incorporates the new ContainerUIElement3D type, to allow for interactivity over the 3D content such as ModelVisual3D objects. This provides a good opportunity to get a practical understanding of WPF's Material types(described in detail on the post linked &lt;A class="" href="http://blogs.msdn.com/wpf3d/archive/2007/03/08/material-behavior.aspx" mce_href="http://blogs.msdn.com/wpf3d/archive/2007/03/08/material-behavior.aspx"&gt;here&lt;/A&gt;).&lt;/P&gt;
&lt;P&gt;This&amp;nbsp;scene was built from a set of 5 images:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Cloud map image with alpha channel or&amp;nbsp;a Cloud Opacity map applied onto the OpacityMask&lt;/LI&gt;
&lt;LI&gt;Earth daytime map &lt;/LI&gt;
&lt;LI&gt;Earth nighttime map &lt;/LI&gt;
&lt;LI&gt;Earth Specular map&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;The Geometry as you may expect was composed of a pair of spheres centered on the same point. The inner sphere model is used for the earth's surface, and has:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;A daytime map applied on a diffuse material. This image&amp;nbsp;is set&amp;nbsp;to full opacity, so no blending of objects behind it will occur, and it will be softly illuminated by external lighting.&lt;/LI&gt;
&lt;LI&gt;The nighttime map is applied on an emissive material. This material has an additive effect where it is rendered, with lighting having no impact(emissive materials render at full intensity). To cut the lighting out of the daytime surface, a moving OpacityMask can be applied.&lt;/LI&gt;
&lt;LI&gt;A map of the earth's watery, reflective surfaces applied using a specular material. Specular materials, like emissive materials have an additive rendering effect, providing bright highlights on the ocean surfaces, while having no contribution over land.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;The Cloud Model uses the same geometry as the earth, with a minor scale transform applied to make&amp;nbsp;the clouds slightly&amp;nbsp;extend beyond the radius of the earth. The clouds are rendered as a Diffuse Material, with the clouds applied.&amp;nbsp;When used with the opacity mask, this produces&amp;nbsp;a mixed&amp;nbsp;effect of fully obscured cloud regions and fully transparent areas.&amp;nbsp;This effect could be carried further with a series of low opacity, blueish diffuse materials to represent the Earth's atmosphere. &lt;/P&gt;
&lt;P&gt;Finally, I placed these two models within a ContainerUIElement3D, applied an animated Rotation Transform to represent the Earth's daily spin. You may have heard - with UIElement behavior on 3D, we can now easily develop 3D UI behaviors, without worrying about hit testing and eventing plumbing. Here, I connected mouse event handlers&amp;nbsp;from XAML and prepared corresponding 3D behavior in response to the events.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4197228" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/pantal/attachment/4197228.ashx" length="1526000" type="application/x-zip-compressed" /><category domain="http://blogs.msdn.com/pantal/archive/tags/WPF/default.aspx">WPF</category><category domain="http://blogs.msdn.com/pantal/archive/tags/3D/default.aspx">3D</category><category domain="http://blogs.msdn.com/pantal/archive/tags/Materials/default.aspx">Materials</category><category domain="http://blogs.msdn.com/pantal/archive/tags/ContainerUIElement3D/default.aspx">ContainerUIElement3D</category></item><item><title>Combined materials for Interesting 3D Planet renderings in WPF</title><link>http://blogs.msdn.com/pantal/archive/2007/08/02/combined-materials-for-interesting-3d-planet-renderings-in-wpf.aspx</link><pubDate>Thu, 02 Aug 2007 07:46:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4182483</guid><dc:creator>pantal</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/pantal/comments/4182483.aspx</comments><wfw:commentRss>http://blogs.msdn.com/pantal/commentrss.aspx?PostID=4182483</wfw:commentRss><description>&lt;P&gt;I have been doing experiments with the&amp;nbsp;materials we provide with WPF to render an interesting facsimile of the surface of the earth. Using a collection from &lt;A href="http://planetpixelemporium.com/earth.html"&gt;http://planetpixelemporium.com/earth.html&lt;/A&gt;, I was able to achieve some nice visual effects:&lt;/P&gt;
&lt;P&gt;&lt;A class="" href="http://blogs.msdn.com/photos/pantal/images/4182404/original.aspx" mce_href="http://blogs.msdn.com/photos/pantal/images/4182404/original.aspx"&gt;&lt;IMG style="WIDTH: 320px; HEIGHT: 230px" height=230 src="http://blogs.msdn.com/photos/pantal/images/4182404/original.aspx" width=320 mce_src="http://blogs.msdn.com/photos/pantal/images/4182404/original.aspx"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A class="" href="http://blogs.msdn.com/photos/pantal/images/4182406/original.aspx" mce_href="http://blogs.msdn.com/photos/pantal/images/4182406/original.aspx"&gt;&lt;IMG style="WIDTH: 320px; HEIGHT: 230px" height=230 src="http://blogs.msdn.com/photos/pantal/images/4182406/original.aspx" width=320 mce_src="http://blogs.msdn.com/photos/pantal/images/4182406/original.aspx"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A class="" href="http://blogs.msdn.com/photos/pantal/images/4182409/original.aspx" mce_href="http://blogs.msdn.com/photos/pantal/images/4182409/original.aspx"&gt;&lt;IMG style="WIDTH: 320px; HEIGHT: 230px" height=230 src="http://blogs.msdn.com/photos/pantal/images/4182409/original.aspx" width=320 mce_src="http://blogs.msdn.com/photos/pantal/images/4182409/original.aspx"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Demo and source is available at this &lt;A class="" href="http://blogs.msdn.com/pantal/archive/2007/08/03/details-on-the-3d-earth-rendering-sample.aspx" mce_href="http://blogs.msdn.com/pantal/archive/2007/08/03/details-on-the-3d-earth-rendering-sample.aspx"&gt;post&lt;/A&gt;.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4182483" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/pantal/archive/tags/WPF/default.aspx">WPF</category><category domain="http://blogs.msdn.com/pantal/archive/tags/3D/default.aspx">3D</category><category domain="http://blogs.msdn.com/pantal/archive/tags/Materials/default.aspx">Materials</category></item><item><title>WPF V3.5 Beta 2 - Goodies in 3D-land!</title><link>http://blogs.msdn.com/pantal/archive/2007/07/31/wpf-v3-5-beta-2-goodies-in-3d-land.aspx</link><pubDate>Tue, 31 Jul 2007 04:26:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4139915</guid><dc:creator>pantal</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/pantal/comments/4139915.aspx</comments><wfw:commentRss>http://blogs.msdn.com/pantal/commentrss.aspx?PostID=4139915</wfw:commentRss><description>&lt;P&gt;Kurt recently put out an overview on&amp;nbsp;the V3.5 &lt;A class="" href="http://blogs.msdn.com/wpf3d/archive/2007/07/30/what-s-new-in-wpf-3-5.aspx" mce_href="http://blogs.msdn.com/wpf3d/archive/2007/07/30/what-s-new-in-wpf-3-5.aspx"&gt;interactive 3D feature additions&lt;/A&gt;&amp;nbsp;(UIElement3D types and Viewport2DVisual3D) which are available in the new &lt;A class="" href="http://www.microsoft.com/downloads/details.aspx?FamilyId=D2F74873-C796-4E60-91C8-F0EF809B09EE&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyId=D2F74873-C796-4E60-91C8-F0EF809B09EE&amp;amp;displaylang=en"&gt;WPF V3.5 Beta 2&lt;/A&gt;. Give it a look!&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4139915" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/pantal/archive/tags/WPF/default.aspx">WPF</category><category domain="http://blogs.msdn.com/pantal/archive/tags/Viewport2DVisual3D/default.aspx">Viewport2DVisual3D</category><category domain="http://blogs.msdn.com/pantal/archive/tags/UIElement3D/default.aspx">UIElement3D</category><category domain="http://blogs.msdn.com/pantal/archive/tags/3D/default.aspx">3D</category><category domain="http://blogs.msdn.com/pantal/archive/tags/3.5/default.aspx">3.5</category></item><item><title>WPF input Interop over DirectX Airspace</title><link>http://blogs.msdn.com/pantal/archive/2007/07/31/managed-directx-interop-with-wpf-part-2.aspx</link><pubDate>Tue, 31 Jul 2007 03:50:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4139454</guid><dc:creator>pantal</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/pantal/comments/4139454.aspx</comments><wfw:commentRss>http://blogs.msdn.com/pantal/commentrss.aspx?PostID=4139454</wfw:commentRss><description>&lt;P&gt;I've seen that the Airspace regions constraints have been a concern for some folks interested in using DirectX with their WPF applications. Based on this, here is a follow-up to&amp;nbsp;an earlier sample I posted, this time using Layered windows to intercept input, allowing for the provision of rich WPF context menus, tooltips, and traditional mouse actions over the airspace of an interop region. It is pretty much the same as before, with one major change - the introduction of an "AirspaceOverlay" decorator. &lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://blogs.msdn.com/photos/pantal/images/4139461/original.aspx" mce_src="http://blogs.msdn.com/photos/pantal/images/4139461/original.aspx"&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;This decorator wraps around your interop content, and accepts an "OverlayChild" which is presented in a layered window over the content in the AirspaceOverlay control. In the example below, I used a canvas with a tooltip and some code-behind to also demonstrate a context menu. Here's a code snippet of the usage:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;MDXControl:AirspaceOverlay&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;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;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;MDXControl:AirspaceOverlay.OverlayChild&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;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"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Canvas&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;ToolTip&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; = &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;A tooltip over a DirectX surface&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Background&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;#01000000&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;Overlay&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/SPAN&gt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;MDXControl:AirspaceOverlay.OverlayChild&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;!--Your Non-WPF Airspace Interop content goes here--&amp;gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;MDXControl:AirspaceOverlay&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Known considerations:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Embedding of&amp;nbsp;AirspaceOverlay&amp;nbsp;in a Viewbox - due to region sizing issues, overlay placeent does not work correctly.&lt;/LI&gt;
&lt;LI&gt;Hit testing within the transparent window will not occur on fully transparent regions, but will continue to propagate down to the interop surface.&amp;nbsp;On the flip side, partially opaque regions will intercept input, preventing it from being recieved on the interop layer.&amp;nbsp;This input handling behavior can be tweaked from the Win32 API's.&lt;/LI&gt;
&lt;LI&gt;Focus will by default switch between the parent and layered child window. I return focus on mouse behavior to the parent in this implementation.&lt;/LI&gt;
&lt;LI&gt;This sample is targeted to rectangular regions. By applying a custom shape consistent with the region below, irregular airspace regions can be overlaid with little additional effort.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;I hope this helps some food for thought for folks looking at similar interop scenarios. Ok, have fun with the code, and feel free to send in questions.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4139454" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/pantal/attachment/4139454.ashx" length="68930" type="application/x-zip-compressed" /><category domain="http://blogs.msdn.com/pantal/archive/tags/WPF/default.aspx">WPF</category><category domain="http://blogs.msdn.com/pantal/archive/tags/DirectX/default.aspx">DirectX</category><category domain="http://blogs.msdn.com/pantal/archive/tags/3D/default.aspx">3D</category><category domain="http://blogs.msdn.com/pantal/archive/tags/Airspaces/default.aspx">Airspaces</category><category domain="http://blogs.msdn.com/pantal/archive/tags/Interop/default.aspx">Interop</category></item><item><title>WPF 3D Transparency Depth-Order Sorting</title><link>http://blogs.msdn.com/pantal/archive/2007/07/23/sorting-for-wpf-3d-transparency.aspx</link><pubDate>Tue, 24 Jul 2007 01:29:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4018612</guid><dc:creator>pantal</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/pantal/comments/4018612.aspx</comments><wfw:commentRss>http://blogs.msdn.com/pantal/commentrss.aspx?PostID=4018612</wfw:commentRss><description>&lt;P mce_keep="true"&gt;Just a quick post here - When making WPF 3D apps, transparency can make for some powerful visual effects. The trouble is that any re-orientation of your scene or the camera will ruin the rendering order of your transparent content to obscure content which should be visible under a transparent surface. Below, we have a little carousel of partially transparent photos rendered on DiffuseMaterials. As per the &lt;A class="" href="http://blogs.msdn.com/wpf3d/archive/2007/03/08/material-behavior.aspx" mce_href="http://blogs.msdn.com/wpf3d/archive/2007/03/08/material-behavior.aspx"&gt;rendering rules with DiffuseMaterials&lt;/A&gt;, only content which is closer to the camera will be rendered. The area highlighted in red is being rendered prematurely, which obscures the background content from being rendered at all.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG title="Unsorted Scene" style="WIDTH: 473px; HEIGHT: 145px" height=145 alt="Unsorted Scene" src="http://blogs.msdn.com/photos/pantal/images/4019022/original.aspx" width=473 mce_src="http://blogs.msdn.com/photos/pantal/images/4019022/original.aspx"&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;To get over this issue with transparency, we must re-order the sequence of transparent content rendering, such that we progressively go from content most distant to the camera, to content in closest proximity.&lt;/P&gt;
&lt;P mce_keep="true"&gt;To deal with this, I created a simple helper to handle sorting of models to sort in order of distance to camera. Below, we have the helper method interface - it takes the camera position, a collection of models and a World transform to offset the models by(This would be all of the accumulated parent transforms, except for the transforms on the Models themselves), and sorts&amp;nbsp;this collection of Models in order of distance to the camera. Here's the API from the attached Code, followed by a carousel of depth sorted images:&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;public static void AlphaSort(Point3D CameraPosition, Model3DCollection Models, Transform3D WorldTransform)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://blogs.msdn.com/photos/pantal/images/4019019/original.aspx" mce_src="http://blogs.msdn.com/photos/pantal/images/4019019/original.aspx"&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Some performance considerations with Depth-Order Sorting favoring transparency:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Limit the scope of models to be sorted to as small a set as possible. Two reasons exist for this. The first is that additional models will require a&amp;nbsp;linearithmic&amp;nbsp;growth of sort time - the CLR Array.Sort algorithm&amp;nbsp;employed with the&amp;nbsp;attached solution&amp;nbsp;operates&amp;nbsp;with an average complexity of O(n log n) and a worst case of O(n^2). The second issue is about GPU fill rate - by sorting in favour of distant objects, we are maximizing the number pixels to render to screen(We get no&amp;nbsp;hardware culling benefits, because everything is in front of what we have rendered so far).&amp;nbsp;On the flip side, if you have a&amp;nbsp; complex scene with lots of opaque, overlapping content, sorting in favour of objects closest to the camera could potentially&amp;nbsp;get you an improved framerate, if sorting is infrequent. &lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Frequency of sorting - With any kind of scene, the supplied sorting operation is not a cheap call to use&amp;nbsp;for real time rendering. As such, I would caution against using this algorithm via CompositionTarget.Rendering.&amp;nbsp;Instead, you may want to give some thought about an invalidation threshold based sorting mechanism. With a 3D arrangement like a carousel, you can work out&amp;nbsp;a safe "interval" of change, within which the content can move, without requiring a re-sort.&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P mce_keep="true"&gt;This sample is just intended as a quick starting point for folks who want to get some depth sorting on their transparent content. It is not tailored to target 3D tree-walking, and most folks can find optimizations for sorting based on domain specific assumptions about their application in terms of graph representation, caching, and all the other common tricks at an application developer's disposal.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4018612" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/pantal/attachment/4018612.ashx" length="2251" type="text/plain" /><category domain="http://blogs.msdn.com/pantal/archive/tags/WPF/default.aspx">WPF</category><category domain="http://blogs.msdn.com/pantal/archive/tags/3D/default.aspx">3D</category><category domain="http://blogs.msdn.com/pantal/archive/tags/Transparency/default.aspx">Transparency</category></item><item><title>Resources for getting into WPF 3D</title><link>http://blogs.msdn.com/pantal/archive/2007/06/29/resources-for-getting-into-3d.aspx</link><pubDate>Fri, 29 Jun 2007 03:27:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3595060</guid><dc:creator>pantal</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/pantal/comments/3595060.aspx</comments><wfw:commentRss>http://blogs.msdn.com/pantal/commentrss.aspx?PostID=3595060</wfw:commentRss><description>&lt;P&gt;Periodically,&amp;nbsp;I need to refer folks to good resources for ramping up on WPF 3D functionality. Here are the ones I commonly refer to:&lt;/P&gt;
&lt;P mce_keep="true"&gt;Mike Hodnick has a great, succinct&amp;nbsp;&lt;A class="" href="http://www.kindohm.com/technical/WPF3DTutorial.htm" mce_href="http://www.kindohm.com/technical/WPF3DTutorial.htm"&gt;WPF 3D tutorial&lt;/A&gt;, which is an excellent resource to get up and running with the technology. If there is any one tutorial to try- I would say go there.&lt;/P&gt;
&lt;P&gt;Charles Petzold has helped countless Windows UI developers ramp up on the technologies - his 3D book blog&amp;nbsp;has a lot of good insights for developers, without making heavy assumptions about a reader's 3D theory knowledge as other resources sometimes do.&amp;nbsp;He has a lot of interesting nuggets on his &lt;A class="" href="http://wpf.netfx3.com/blogs/wpf_community_bloggers/archive/tags/3D+Book/default.aspx" mce_href="http://wpf.netfx3.com/blogs/wpf_community_bloggers/archive/tags/3D+Book/default.aspx"&gt;3D book blog&lt;/A&gt;, often demonstrating the power of XAML, as well as a 3D samples &lt;A class="" href="http://www.charlespetzold.com/3D/index.html" mce_href="http://www.charlespetzold.com/3D/index.html"&gt;page&lt;/A&gt;. As&amp;nbsp;he is a&amp;nbsp;frequent contributor to MSDN magazine, I periodically&amp;nbsp;encounter his articles introducing users to technology like the &lt;A class="" href="http://msdn.microsoft.com/msdnmag/issues/07/04/Foundations/default.aspx" mce_href="http://msdn.microsoft.com/msdnmag/issues/07/04/Foundations/default.aspx"&gt;MeshGeometry3D&lt;/A&gt; type which can be quite helpful.&lt;/P&gt;
&lt;P&gt;The &lt;A class="" href="http://blogs.msdn.com/wpf3d/" mce_href="http://blogs.msdn.com/wpf3d/"&gt;3D Team&lt;/A&gt; blog and &lt;A class="" href="http://blogs.msdn.com/danlehen/" mce_href="http://blogs.msdn.com/danlehen/"&gt;Daniel Lehenbauer's blog&lt;/A&gt;&amp;nbsp;are more topical resources, with references to a lot of cool new applications, or addressing common questions.&lt;/P&gt;
&lt;P&gt;The &lt;A class="" href="http://www.codeplex.com/3DTools" mce_href="http://www.codeplex.com/3DTools"&gt;3D tools&lt;/A&gt; package isn't a tutorial per-se, but a library of goodies for use with WPF, by the 3D team. Any serious WPF 3D developer should be aware&amp;nbsp;of the cool&amp;nbsp;offerings in this&amp;nbsp;package.&lt;/P&gt;
&lt;P&gt;Depending on your application domain, you may want to see this "casual" game developer's tutorial for WPF3D - "&lt;A class="" href="http://www.dmu.com/link1.html" mce_href="http://www.dmu.com/link1.html"&gt;Creating 3D Webgames using ATMO NQAL 2.0"&lt;/A&gt;. The tilt on this series of tutorials is quite distinctive, and delves into quite a bit of application details. Definitely different from your typical WPF/3D tutorial :)&lt;/P&gt;
&lt;P&gt;Books:&lt;/P&gt;
&lt;P&gt;&lt;A class="" href="http://www.amazon.com/Windows-Presentation-Foundation-Unleashed-WPF/dp/0672328917" mce_href="http://www.amazon.com/Windows-Presentation-Foundation-Unleashed-WPF/dp/0672328917"&gt;WPF Unleashed&lt;/A&gt;&amp;nbsp;- Adam Nathan brought in Daniel Lehenbauer&amp;nbsp;(3D dev team lead for V1 WPF) to prepare the 3D chapter in this title. An excellent ramp up to 3D.&lt;/P&gt;
&lt;P&gt;&lt;A class="" href="http://www.amazon.com/3D-Programming-Windows-Pro-Developer/dp/0735623945" mce_href="http://www.amazon.com/3D-Programming-Windows-Pro-Developer/dp/0735623945"&gt;3D Programming for Windows &lt;/A&gt;- Charles Petzold's new book on WPF 3D&amp;nbsp;is now available. I haven't had a chance to get my hands on this one yet, but based on his blog and prior writings, you can expect a detailed coverage of the subject.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3595060" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/pantal/archive/tags/WPF/default.aspx">WPF</category><category domain="http://blogs.msdn.com/pantal/archive/tags/3D/default.aspx">3D</category></item></channel></rss>