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.
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:
<ImageBrush ImageSource="Your 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.