我知道ModelVisual3D
可以通过AxisAngleRotation3D
围绕任意轴旋转,但是可以对包含9 ModelVisual3D
s的Viewport3D执行相同操作,因此它们可以一起旋转好像它们是一个对象..例如,我可以使用ModelVisual3D
执行此操作:
<Viewport3D.Triggers>
<EventTrigger RoutedEvent="Viewport3D.Loaded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="myVerticalRotation"
Storyboard.TargetProperty="Angle"
From="0" To="360" Duration="0:0:10"
RepeatBehavior="Forever" />
<DoubleAnimation
Storyboard.TargetName="myHorizontalRotation"
Storyboard.TargetProperty="Angle"
From="0" To="360" Duration="0:0:9"
RepeatBehavior="Forever" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Viewport3D.Triggers>
但这假定Viewport3D
只包含一个ModelVisual3D
答案 0 :(得分:0)
是的,可以通过在GeometryModel3D
内Model3DGroup
内的ModelUIElement3D
内包含所有ContainerUIElement3D
个对象来实现,然后我们就可以定义RotateTransform3D
中的ContainerUIElement3D.Transform
:
<ContainerUIElement3D>
<ModelUIElement3D>
<Model3DGroup>
<GeometryModel3D>...</GeometryModel3D>
<GeometryModel3D>...</GeometryModel3D>
<GeometryModel3D>...</GeometryModel3D>
</Model3DGroup>
</ModelUIElement3D>
<ContainerUIElement3D.Transform>
<Transform3DGroup>
<RotateTransform3D >
<RotateTransform3D.Rotation>
<AxisAngleRotation3D x:Name="myHorizontalRotation" Angle="142.884" Axis="0 1 0"/>
</RotateTransform3D.Rotation>
</RotateTransform3D>
</Transform3DGroup>
</ContainerUIElement3D.Transform>
</ContainerUIElement3D>