言語

QuaternionRotation3D クラス

定義

四元数として定義された回転変換を表します。

public ref class QuaternionRotation3D sealed : System::Windows::Media::Media3D::Rotation3D
public sealed class QuaternionRotation3D : System.Windows.Media.Media3D.Rotation3D
type QuaternionRotation3D = class
    inherit Rotation3D
Public NotInheritable Class QuaternionRotation3D
Inherits Rotation3D
継承

//Read new settings
try
{
    Double WValue = System.Convert.ToDouble(QuaternionWText.Text);
    Double XValue = System.Convert.ToDouble(QuaternionXText.Text);
    Double YValue = System.Convert.ToDouble(QuaternionYText.Text);
    Double ZValue = System.Convert.ToDouble(QuaternionZText.Text);

    endQuaternion = new Quaternion(XValue, YValue, ZValue, WValue);
}
catch
{
    MessageBox.Show("Set non-null values for the quaternion.");
}

myQuaternionRotation3D = new QuaternionRotation3D(endQuaternion);
myRotateTransform3D.Rotation = myQuaternionRotation3D;

//update matrix display
qrotationMatrix3D = myRotateTransform3D.Value;
'Read new settings
Try
    Dim WValue As Double = Convert.ToDouble(QuaternionWText.Text)
    Dim XValue As Double = Convert.ToDouble(QuaternionXText.Text)
    Dim YValue As Double = Convert.ToDouble(QuaternionYText.Text)
    Dim ZValue As Double = Convert.ToDouble(QuaternionZText.Text)

    endQuaternion = New Quaternion(XValue, YValue, ZValue, WValue)
Catch
    MessageBox.Show("Set non-null values for the quaternion.")
End Try

myQuaternionRotation3D = New QuaternionRotation3D(endQuaternion)
myRotateTransform3D.Rotation = myQuaternionRotation3D

'update matrix display
qrotationMatrix3D = myRotateTransform3D.Value
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
  <DockPanel>
    <Viewbox>
      <Canvas Width="321" Height="201">

        <!-- The Viewport3D provides a rendering surface for 3-D visual content. -->
        <Viewport3D Name="MyAnimatedObject"
          ClipToBounds="True" Width="150" Height="150"
          Canvas.Left="0" Canvas.Top="10">

          <!-- Defines the camera used to view the 3D object. -->
          <Viewport3D.Camera>
            <PerspectiveCamera x:Name="myPerspectiveCamera" Position="0,0,2" LookDirection="0,0,-1" 
             FieldOfView="60" />
          </Viewport3D.Camera>

          <!-- The ModelVisual3D children contain the 3D models -->
          <Viewport3D.Children>

            <!-- This ModelVisual3D defines the lights cast in the scene. Without light, the
                 3D object cannot be seen. Also, the direction of the lights affect shadowing. -->
            <ModelVisual3D>
              <ModelVisual3D.Content>
                <DirectionalLight Color="#FFFFFF" Direction="-0.612372,-0.5,-0.612372" />
              </ModelVisual3D.Content>
            </ModelVisual3D>
            <ModelVisual3D>
              <ModelVisual3D.Content>
                <GeometryModel3D>

                  <!-- The geometry specifes the shape of the 3D plane. In this case, a flat sheet is created. -->
                  <GeometryModel3D.Geometry>
                    <MeshGeometry3D
                     TriangleIndices="0,1,2 3,4,5 "
                     Normals="0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 "
                     TextureCoordinates="0,0 1,0 1,1 1,1 0,1 0,0 "
                     Positions="-0.5,-0.5,0.5 0.5,-0.5,0.5 0.5,0.5,0.5 0.5,0.5,0.5 -0.5,0.5,0.5 -0.5,-0.5,0.5 " />
                  </GeometryModel3D.Geometry>

                  <!-- The material specifies the material applied to the plane. In this case it is a linear gradient.-->
                  <GeometryModel3D.Material>
                    <MaterialGroup>
                      <DiffuseMaterial>
                        <DiffuseMaterial.Brush>
                          <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
                            <LinearGradientBrush.GradientStops>
                              <GradientStop Color="Yellow" Offset="0" />
                              <GradientStop Color="Red" Offset="0.25" />
                              <GradientStop Color="Blue" Offset="0.75" />
                              <GradientStop Color="LimeGreen" Offset="1" />
                            </LinearGradientBrush.GradientStops>
                          </LinearGradientBrush>
                        </DiffuseMaterial.Brush>
                      </DiffuseMaterial>
                    </MaterialGroup>
                  </GeometryModel3D.Material>
                  <!-- The Transform specifies how to transform the 3D object. The rotation
                       is animated using the Storyboard below. -->
                  <GeometryModel3D.Transform>
                    <RotateTransform3D>
                      <RotateTransform3D.Rotation>
                        <QuaternionRotation3D x:Name="myQuaternionRotation3D" />
                      </RotateTransform3D.Rotation>
                    </RotateTransform3D>
                  </GeometryModel3D.Transform>
                </GeometryModel3D>
              </ModelVisual3D.Content>
            </ModelVisual3D>
          </Viewport3D.Children>
          <!-- Trigger the rotation animation when the 3D object loads. -->
          <Viewport3D.Triggers>
            <EventTrigger RoutedEvent="Viewport3D.Loaded">
              <BeginStoryboard>
                <Storyboard>

                  <!-- This animation animates the Rotation property of the RotateTransform3D
                       causing the 3D shape to rotate. -->
                  <QuaternionAnimation
                   Storyboard.TargetName="myQuaternionRotation3D"
                   Storyboard.TargetProperty="Quaternion" From="0,0,1,0" To="0.3, 0.3, 1, 0" 
                   Duration="0:0:2" />

                </Storyboard>
              </BeginStoryboard>
            </EventTrigger>
          </Viewport3D.Triggers>
        </Viewport3D>
      </Canvas>
    </Viewbox>
  </DockPanel>
</Page>

コンストラクター

名前 説明
QuaternionRotation3D()

QuaternionRotation3D クラスの新しいインスタンスを初期化します。

QuaternionRotation3D(Quaternion)

指定したQuaternionRotation3Dを使用して、Quaternion クラスの新しいインスタンスを初期化します。

フィールド

名前 説明
QuaternionProperty

Quaternion依存関係プロパティを識別します。

プロパティ

名前 説明
CanFreeze

オブジェクトを変更不可にできるかどうかを示す値を取得します。

(継承元 Freezable)
DependencyObjectType

このインスタンスの CLR 型をラップする DependencyObjectType を取得します。

(継承元 DependencyObject)
Dispatcher

このDispatcherが関連付けられているDispatcherObjectを取得します。

(継承元 DispatcherObject)
HasAnimatedProperties

1 つ以上の AnimationClock オブジェクトがこのオブジェクトの依存関係プロパティのいずれかに関連付けられているかどうかを示す値を取得します。

(継承元 Animatable)
IsFrozen

オブジェクトが現在変更可能かどうかを示す値を取得します。

(継承元 Freezable)
IsSealed

このインスタンスが現在シールされているかどうかを示す値を取得します (読み取り専用)。

(継承元 DependencyObject)
Quaternion

移動先の回転を定義する Quaternion を取得または設定します。

メソッド

名前 説明
ApplyAnimationClock(DependencyProperty, AnimationClock, HandoffBehavior)

指定したAnimationClockDependencyPropertyを適用します。 プロパティが既にアニメーション化されている場合は、指定した HandoffBehavior が使用されます。

(継承元 Animatable)
ApplyAnimationClock(DependencyProperty, AnimationClock)

指定したAnimationClockDependencyPropertyを適用します。 プロパティが既にアニメーション化されている場合は、 SnapshotAndReplace ハンドオフ動作が使用されます。

(継承元 Animatable)
BeginAnimation(DependencyProperty, AnimationTimeline, HandoffBehavior)

指定した DependencyPropertyにアニメーションを適用します。 アニメーションは、次のフレームがレンダリングされるときに開始されます。 指定したプロパティが既にアニメーション化されている場合は、指定した HandoffBehavior が使用されます。

(継承元 Animatable)
BeginAnimation(DependencyProperty, AnimationTimeline)

指定した DependencyPropertyにアニメーションを適用します。 アニメーションは、次のフレームがレンダリングされるときに開始されます。 指定したプロパティが既にアニメーション化されている場合は、 SnapshotAndReplace ハンドオフ動作が使用されます。

(継承元 Animatable)
CheckAccess()

呼び出し元のスレッドがこの DispatcherObjectにアクセスできるかどうかを判断します。

(継承元 DispatcherObject)
ClearValue(DependencyProperty)

プロパティのローカル値をクリアします。 クリアするプロパティは、 DependencyProperty 識別子によって指定されます。

(継承元 DependencyObject)
ClearValue(DependencyPropertyKey)

読み取り専用プロパティのローカル値をクリアします。 クリアするプロパティは、 DependencyPropertyKeyによって指定されます。

(継承元 DependencyObject)
Clone()

この QuaternionRotation3Dの変更可能な複製を作成し、このオブジェクトの値の詳細コピーを作成します。 依存関係プロパティをコピーする場合、このメソッドはリソース参照とデータ バインディングをコピーします (ただし、解決されなくなる可能性があります)、アニメーションやその現在の値はコピーしません。

CloneCore(Freezable)

基本 (アニメーション化されていない) プロパティ値を使用して、インスタンスを指定した Freezable の複製 (ディープ コピー) にします。

(継承元 Freezable)
CloneCurrentValue()

この QuaternionRotation3D オブジェクトの変更可能な複製を作成し、このオブジェクトの現在の値の詳細コピーを作成します。 リソース参照、データ バインディング、およびアニメーションはコピーされませんが、現在の値はコピーされます。

CloneCurrentValueCore(Freezable)

現在のプロパティ値を使用して、インスタンスを指定した Freezable の変更可能な複製 (ディープ コピー) にします。

(継承元 Freezable)
CoerceValue(DependencyProperty)

指定した依存関係プロパティの値を強制します。 これは、呼び出し元のCoerceValueCallbackに存在する依存関係プロパティのプロパティ メタデータで指定されたDependencyObject関数を呼び出すことによって実現されます。

(継承元 DependencyObject)
CreateInstance()

Freezable クラスの新しいインスタンスを初期化します。

(継承元 Freezable)
CreateInstanceCore()

派生クラスで実装された場合は、 Freezable 派生クラスの新しいインスタンスを作成します。

(継承元 Freezable)
Equals(Object)

指定された DependencyObject が現在の DependencyObjectと等しいかどうかを判断します。

(継承元 DependencyObject)
Freeze()

現在のオブジェクトを変更不可にし、その IsFrozen プロパティを trueに設定します。

(継承元 Freezable)
FreezeCore(Boolean)

この Animatable オブジェクトを変更不可にするか、変更不可にできるかどうかを判断します。

(継承元 Animatable)
GetAnimationBaseValue(DependencyProperty)

指定した DependencyPropertyのアニメーション化されていない値を返します。

(継承元 Animatable)
GetAsFrozen()

基本 (アニメーション化されていない) プロパティ値を使用して、 Freezableの固定コピーを作成します。 コピーは固定されているため、固定されたサブオブジェクトは参照によってコピーされます。

(継承元 Freezable)
GetAsFrozenCore(Freezable)

基本 (アニメーション化されていない) プロパティ値を使用して、インスタンスを指定した Freezable の固定複製にします。

(継承元 Freezable)
GetCurrentValueAsFrozen()

現在のプロパティ値を使用して、 Freezable の固定コピーを作成します。 コピーは固定されているため、固定されたサブオブジェクトは参照によってコピーされます。

(継承元 Freezable)
GetCurrentValueAsFrozenCore(Freezable)

現在のインスタンスを、指定した Freezableの固定複製にします。 オブジェクトにアニメーション化された依存関係プロパティがある場合は、現在のアニメーション化された値がコピーされます。

(継承元 Freezable)
GetHashCode()

この DependencyObjectのハッシュ コードを取得します。

(継承元 DependencyObject)
GetLocalValueEnumerator()

この DependencyObjectでローカルに値が設定されている依存関係プロパティを決定するための特殊な列挙子を作成します。

(継承元 DependencyObject)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
GetValue(DependencyProperty)

DependencyObjectのこのインスタンスの依存関係プロパティの現在の有効な値を返します。

(継承元 DependencyObject)
InvalidateProperty(DependencyProperty)

指定した依存関係プロパティの有効な値を再評価します。

(継承元 DependencyObject)
MemberwiseClone()

現在の Objectの簡易コピーを作成します。

(継承元 Object)
OnChanged()

現在の Freezable オブジェクトが変更されたときに呼び出されます。

(継承元 Freezable)
OnFreezablePropertyChanged(DependencyObject, DependencyObject, DependencyProperty)

このメンバーは、Windows Presentation Foundation (WPF) インフラストラクチャをサポートしており、コードから直接使用するためのものではありません。

(継承元 Freezable)
OnFreezablePropertyChanged(DependencyObject, DependencyObject)

設定したばかりの DependencyObjectType データ メンバーに対して適切なコンテキスト ポインターが確立されるようにします。

(継承元 Freezable)
OnPropertyChanged(DependencyPropertyChangedEventArgs)

DependencyObjectOnPropertyChanged(DependencyPropertyChangedEventArgs)実装をオーバーライドして、Changed型の依存関係プロパティの変化に応じてFreezable ハンドラーも呼び出します。

(継承元 Freezable)
ReadLocalValue(DependencyProperty)

依存関係プロパティが存在する場合は、そのローカル値を返します。

(継承元 DependencyObject)
ReadPreamble()

Freezableが有効なスレッドからアクセスされていることを確認します。 Freezableの継承子は、依存関係プロパティではないデータ メンバーを読み取る API の先頭でこのメソッドを呼び出す必要があります。

(継承元 Freezable)
SetCurrentValue(DependencyProperty, Object)

値ソースを変更せずに依存関係プロパティの値を設定します。

(継承元 DependencyObject)
SetValue(DependencyProperty, Object)

依存関係プロパティ識別子で指定された依存関係プロパティのローカル値を設定します。

(継承元 DependencyObject)
SetValue(DependencyPropertyKey, Object)

依存関係プロパティの DependencyPropertyKey 識別子で指定された、読み取り専用の依存関係プロパティのローカル値を設定します。

(継承元 DependencyObject)
ShouldSerializeProperty(DependencyProperty)

シリアル化プロセスが指定された依存関係プロパティの値をシリアル化する必要があるかどうかを示す値を返します。

(継承元 DependencyObject)
ToString()

現在のオブジェクトを表す文字列 を返します。

(継承元 Rotation3D)
ToString(IFormatProvider)

現在のStringを表す指定した形式を使用してObjectを返します。

(継承元 Rotation3D)
VerifyAccess()

呼び出し元のスレッドがこの DispatcherObjectにアクセスできるように強制します。

(継承元 DispatcherObject)
WritePostscript()

ChangedFreezable イベントを発生させ、そのOnChanged() メソッドを呼び出します。 Freezableから派生するクラスは、依存関係プロパティとして格納されていないクラス メンバーを変更する API の末尾でこのメソッドを呼び出す必要があります。

(継承元 Freezable)
WritePreamble()

Freezableが固定されていないこと、および有効なスレッド コンテキストからアクセスされていることを確認します。 Freezable 継承子は、依存関係プロパティではないデータ メンバーに書き込む API の先頭でこのメソッドを呼び出す必要があります。

(継承元 Freezable)

イベント

名前 説明
Changed

Freezableまたはそれに含まれるオブジェクトが変更されたときに発生します。

(継承元 Freezable)

明示的なインターフェイスの実装

名前 説明
IFormattable.ToString(String, IFormatProvider)

指定した形式を使用して、現在のインスタンスの値を書式設定します。

(継承元 Rotation3D)

適用対象