是否可以围绕三个轴中的任何一个旋转 Viewport3D?

Is it possible to rotate Viewport3D around any of the three axes?

我知道 ModelVisual3D 可以通过 AxisAngleRotation3D 绕任何轴旋转,但是是否可以对包含 9 个 ModelVisual3D 的 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

是的,可以通过将所有 GeometryModel3D 对象包含在 Model3DGroupModelUIElement3DContainerUIElement3D 内,然后我们可以定义 RotateTransform3DContainerUIElement3D.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>