in

blendables

New Tile Turn Sample for 3D Mix

One of our forum users asked if we had a CoverFlow like sample to share for the 3D Mix.  In fact we've had this sample in mind for a bit so this was a perfect opportunity to release it to the community.

 

You can find the sample here:  http://blendables.com/files/folders/3d_samples/entry829.aspx

One of our engineers John Zolezzi put together the following writeup explaining the sample. 

To utilize it, just open in Visual Studio 2008, add the IdentityMine.Windows and IdentityMine.Windows.Media3D references and you should be good to go.

Blendables 3D mix gives you the flexibility to create your own custom layouts.   This example shows how to create your own layout and model generator to implement your own tile turn view.  This is similar to the one found in iTunes cover flow.  The key classes that implement this custom layout are TileTurnLayout and ModelFromTemplateVisual3DGenerator.

TileTurnLayout class controls how the models are placed in the view by implementing a function called GetItemTransforms from Layout3D.  GetItemTransforms passes a list of created models and data associated for each item.  The function expects a list of Transform3D objects for each item.  You can create multiple transforms for each item by using a Transform3DGroup. 

The class also has a property called CenteredItemOffset which controls which item is centered in the view.  When this property is changed the 3D mix framework calls GetItemTransforms again. Notice that this property is a double instead of a normal index value to allow smooth animation by calling GetItemTransforms more often.  So from 0 to 1, you would get calls for 0.1, 0.2, 0.4, 0.6, etc as determined by the animation you have setup.  This example has the slide animation defined:

<DoubleAnimation x:Key="SlideAnimation" Duration="0:0:0.7" DecelerationRatio="1" AccelerationRatio="0" />

The second part of this implementation is creating the models from the data in TileTurnControl’s ItemsSource.   We created a custom model generator called ModelFromTemplateVisual3DGenerator.  This class creates the model with reflection from each item passed to ItemsSource.  It also uses a DataTemplate passed to the TileTurnControl.   It implements GetItemVisual3D defined in Visual3DGeneratorBase.  GetItemVisual3D pass you the data from the item and expects a model in return.

Published Mar 26 2009, 01:02 PM by kurt.brockett
Filed under:

Comments

 

BigDubb said:

I downloaded the sample libraries and there are no additional DLLs installed, so it won't compile. On a related note, this functionality should be much more readily available with SL3. Are there plans to release this control utilizing the projection properties that are a part of SL3? Thanks.
March 30, 2009 10:56 AM
 

kurt.brockett said:

Hi BigDubb,

   It wasn't bolded in the post but I moved the instructions to their own paragraph and bolded them as well.  To run the app you need to download and install the 3D Mix which you can find here: blendables.com/.../default.aspx

Then add IdentityMine.Windows and IdentityMine.Windows.Media3D to the project and build.

Right now we are not planning on porting this to SL3 as we remain focused on WPF for the time being.  

Thanks,

Kurt

March 30, 2009 11:33 AM
Copyright © 2007 IdentityMine, Inc.  | Careers  | Policies  | License  | News & Press