Simple Perspective 3D in Silverlight 3

Posted by Corey on March 18, 2009 at 12:28 pm.

Perspective 3D comes to Silverlight!  Below is a simple example on how to add Perspective 3d to your project.  First, this is what the resulting application is going to look like, then we’ll dive into the code:

Download the code | See the example in action

image

XAML

There are two new features of note in this example.  First, and foremost, the projection 3d tag to the Image:

image

Secondly, is element binding.  The below XAML shows a Slider with the Value property bound to the PlaneProjections’s RotationY value.  Notice the mode is TwoWay, meaning values updated by either the Slider or the RotationY value.  In addition to the Slider binding, the Text property of the TextBlock is bound to the Slider Value.

image

and binding the value of the Slider to the value of the RotationY:

 

C#

There is no code required to run this.  All the magic happens with the element binding.

 

 

5 Responses to “Simple Perspective 3D in Silverlight 3”

Leave a Reply