1

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

4

1 回答 1

1

是的,可以通过在inside inside中包含所有GeometryModel3D对象,然后我们可以定义in :Model3DGroupModelUIElement3DContainerUIElement3DRotateTransform3DContainerUIElement3D.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>
于 2018-02-04T07:39:03.710 回答