Version

Rotation

Purpose

This topic explains how to configure the XamScatterSurface3D™ control rotation using code.

Required background

The following topics are prerequisites to understanding this topic:

Topic Purpose

This topic provides detailed instructions to help you get up and running as soon as possible with the xamScatterSurface3D™ control.

This topic explains the features supported by the control from developer perspective.

This topic provides an overview of the visual elements of the control.

The following table lists the external articles required as a prerequisite to understanding this topic.

Type Content

Concept

3-D rotation

Article Purpose

This articles describes how to use the abstract Rotation3D class in WPF.

This articles describes how to represent a 3-D rotation of a specified angle about a specified axis.

This articles describes how to represent a rotation transformation defined as a quaternion.

Configuring Rotation Specifying an Axis and Angle

Overview

Use the Rotation property to set rotation programmatically in the xamScatterSurface3D control.

Set the Rotation property to an AxisAngleRotation3D object with specified angle and axis of rotation.

Property settings

The following table maps the desired configuration to the property settings that manage it.

In order to: Use this property: And set it to:

Perform rotation by specifying an axis and angle

AxisAngleRotation3D

Example

The screenshot below demonstrates how the xamScatterSurface3D control looks as a result of the following settings – 60 degrees rotation around the Y axis:

Property Value

<AxisAngleRotation3D Angle="60" Axis="0 1 0" />

Rotation.png

Following is the code that implements this example.

In XAML:

<ig:XamScatterSurface3D Name="SurfaceChart"
 ItemsSource="{Binding Path=DataCollection}"
 XMemberPath="X" YMemberPath="Y" ZMemberPath="Z">
    <ig:XamScatterSurface3D.Rotation>
        <AxisAngleRotation3D Angle="60" Axis="0 1 0" />
    </ig:XamScatterSurface3D.Rotation>
</ig:XamScatterSurface3D>

In C#:

var axis = new Vector3D(0, 1, 0);
var axisAngleRotation3D = new AxisAngleRotation3D(axis, 60);
SurfaceChart.Rotation = axisAngleRotation3D;

In Visual Basic:

Dim axis = New Vector3D(0, 1, 0)
Dim axisAngleRotation3D = New AxisAngleRotation3D(axis, 60)
SurfaceChart.Rotation = axisAngleRotation3D

Configuring Rotation using Quaternion

Overview

Use the Rotation property to set rotation programmatically in the xamScatterSurface3D control.

Set the Rotation property to a QuaternionRotation3D object that represents a rotation transformation defined as a quaternion.

If the rotation axes are named ax, ay and az and the angle of rotation is named theta, you can calculate the quaternion using the following formula:

The quaternion (x, y, z, w) is:

x = ax * sin(theta/2)

y = ay * sin(theta/2)

z = az * sin(theta/2)

w = cos(theta/2)

So if you want to rotate the xamScatterSurface3D control around the Y axis and with angle of 60 degrees as the example above, the quaternion will be equal to (0, 0.5, 0, 0.866).

Property settings

The following table maps the desired configuration to the property settings that manage it.

In order to: Use this property: And set it to:

Perform rotation using quaternion

QuaternionRotation3D

Example

The screenshot below demonstrates how the xamScatterSurface3D control looks as a result of the following code:

Rotation.png

Following is the code that implements this example.

In XAML:

<ig:XamScatterSurface3D Name="SurfaceChart"
 ItemsSource="{Binding Path=DataCollection}"
 XMemberPath="X" YMemberPath="Y" ZMemberPath="Z">
    <ig:XamScatterSurface3D.Rotation>
        <QuaternionRotation3D Quaternion="0, 0.5, 0, 0.866" />
    </ig:XamScatterSurface3D.Rotation>
</ig:XamScatterSurface3D>

In C#:

…
var quaternion = new Quaternion();
quaternion.X = 0;
quaternion.Y = 0.5;
quaternion.Z = 0;
quaternion.W = 0.866;
var quaternionRotation3D = new QuaternionRotation3D();
quaternionRotation3D.Quaternion = quaternion;
SurfaceChart.Rotation = quaternionRotation3D;

In Visual Basic:

…
Dim quaternion = New Quaternion()
quaternion.X = 0
quaternion.Y = 0.5
quaternion.Z = 0
quaternion.W = 0.866
Dim quaternionRotation3D = New QuaternionRotation3D()
quaternionRotation3D.Quaternion = quaternion
SurfaceChart.Rotation = quaternionRotation3D

Related Content

Topics

The following topics provide additional information related to this topic.

Topic Purpose

This topic explains how to configure the aspect and perspective of the xamScatterSurface3D control.

The topics in this group explain how to configure different axis settings in the xamScatterSurface3D control.

This topic explains how to configure to the crosshairs in the xamScatterSurface3D control.

This topic explains how to configure the rim thickness and the material of the cube of the xamScatterSurface3D control.

The topics in this group explain how to configure the data point markers in the xamScatterSurface3D control.

This topic explains how to configure the floor settings of the xamScatterSurface3D control.

This topic explains how the xamScatterSurface3D control performance can be optimized when rendering a large set of data points.

The topics in this group explain how to configure different series settings in the xamScatterSurface3D control.

This topic explains how to show/hide the default tooltip and how apply a custom tooltip using DataTemplate in the xamScatterSurface3D control.

This topic explains how to perform the scaling of the xamScatterSurface3D control.