12,454,104 members (53,859 online)
Tip/Trick
alternative version

6.9K views
5 bookmarked
Posted

# 3D effects in Windows Store App

, 2 Feb 2014 CPOL
 Rate this:
A description of how images and other controls can be rotated and used to give 3d Effect in Windows Store Apps

## Introduction

3D effects can be applied to Windows Store apps using Transforms. Rotation of an object is possible along all the Three axis : X, Y and Z. Object appears to be Rotated by the respective angle supplied to it through the transfor.

## Background

This article helps to get acquainted to the various rotation that can be carried out on a xaml object.

## Using the code

In this example, we will take a look into PlaneProjection, it’s rotation angle and Center of rotation. All three play a crucial role in 3D designs in XAML.
PlaneProjection exposes to various properties that can be used to give a 3D effect. In which the RotationAngle helps us to decide the angle by which the object is to be rotated.
CenterOfRotation property decides the point about which the object is to be rotated.
We will see the rotation by an angle and the change of CenterOfRotation, how it differs from the default Point about which it is rotated.

Following is the image for reference of the Entire code and a better understanding

The top row shows the Images with rotation and default Center of rotation ie: 0.5 which means the images are to be rotated with the specified angle and the point of rotation will be the center of the image. Where CenterOfRotation being defined on a scale of 0 to 1 – 0.5 being the center.
In the 2nd Row we have the same images to be rotated with the ssame angle of rotation but varying center of rotation. As a result they appear more tilted in some case.

How to specify the center of rotation:

From the example we see that if rotation is along X axis then Center of Rotation has been mentioned as Y and vice versa. It is because when an Image is rotated along the X axis the effected points along which rotation can occur lies on the Y axis and vice versa. Simillarly in case of rotation along Z axis the points lie on Both X & Y as a result both are mentioned.

Below is the code snippet:

```<Grid>
<Grid.Background>
</Grid.Background>```

Points of Interest

Using the plane projection with respective controls the 3D Effect can be formed for Controls available for windows store app. Main role in a 3D effect is played by the RotationX, RotationY and RotationZ properties which is used to specify the angle of rotation.

## Share

 Software Developer Mindfire Solutions India
No Biography provided

## You may also be interested in...

 Pro Pro

 First Prev Next
 My vote of 1 dafgfddfgv4-Feb-14 7:36 dafgfddfgv 4-Feb-14 7:36
 Re: My vote of 1 AnobikDey4-Feb-14 16:45 AnobikDey 4-Feb-14 16:45
 Good Tip Pranay Rana3-Feb-14 6:42 Pranay Rana 3-Feb-14 6:42
 Last Visit: 31-Dec-99 18:00     Last Update: 29-Aug-16 15:43 Refresh 1