Coding4Fun Blog

Housebuilding with John Papa and Sliverlight 5 at MIX11

Description

John Papa shows us some of the cool new 3D capabilities coming in Silverlight 5, in the 3D Housebuilding demo he gave during the MIX11 Day 2 keynote.

3D Housebuilder demo from MIX11

image

In order to this solution to open and compile you'll likely need (well I needed anyway) both Microsoft Expression Blend Preview for Silverlight 5 and Microsoft Silverlight 5 Beta Tools for Visual Studio 2010 Service Pack 1 

Once that's installed you should be able open and run the solution. Remember though that this is demo code. It's not a 100% complete application and here's stuff in it that isn't hooked up. But it's a cool demo... Smiley

image

As you'd expect this is a MVVM based project

image

Much of the app's magic is in the Controls.

image

Here's a bit more information about the code from his Silverlight 5 3D Housebuilder Project Shown at MIX11 post.

Application workflow

  • Select a type of house to start from a base model
  • Add details like doors and windows and customize their color
  • Change the camera angle using the arrow keys
  • The brick house has layering, so you can remove layers and view the interior of the house
  • View the final price list of materials

Technical topics

  • Integrate Silverlight UI with XNA 3D using DrawingSurface
  • Load and render a 3D model (partial COLLADA support)
  • Configure the graphics pipeline for rendering
  • Load and mipmap textures
  • Apply pixel and vertex shaders
  • Project 2D mouse coordinates into 3D space
  • Use the MVVM pattern
  • Create custom UI controls
  • The color swatches in step 2 use binding in style setters to apply the colors to the door and shutter models
  • The construction list in step 3 uses implicit data templates
  • Some templates in the construction list in step 3 use the RelativeSource Ancestor feature to load their ItemsSource
  • The demo set a breakpoint on the price of the door in the door template (in the construction list in step 3) to demonstrate data binding debugging. You can do this anywhere you choose.

So if you saw John's MIX11 demo during the Daye 2 Keynote, or just want to see a some how the new 3D stuff will work in Silverlight 5, this code is waiting for you...

Here’s a few more links you might find interesting (almost all copied from John's post):

The Discussion

  • Vuosaaren ATK

    Thanks for your time!!!

  • Clinton Gallagher ​virtualCable​TV

    Since Microsoft blew the opportunity to acquire SketchUp for peanuts but still has a close partnership with Autodesk these types of models I've referred to as "The next era of CAD" implemented in Silverlight will go nowhere unless Microsoft can pursuade Autodesk to allow their products to export XAML.

    As it is now I've been told by one of their architects that Autodesk embeds XAML in their Design Web Format eXchange format (DWFx) but it takes COM to get it out as they require the use of their DWFx SDK. With my hands and head full enough with C#, Silverlight and WP7 I won't even try to touch that with a ten foot ++.

    Johhny, why not spread this around thye campus and maybe somebody will take it up to suck that XAML out of DWFx files.

    // DWFx
    http://en.wikipedia.org/wiki/Design_Web_Format

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.