Rotate an object in HelixViewport3D in a WPF app

大憨熊 提交于 2019-12-05 12:10:02

You couldn't find it in the toolkit, because it's a standard WPF function. So in your example it would look somewhat like this:

<ModelVisual3D x:Name="Models">
    <ModelVisual3D.Transform>
        <Transform3DGroup>
            <RotateTransform3D>
                <RotateTransform3D.Rotation>
                     <AxisAngleRotation3D Axis="1,0,0" Angle="{Binding varX}"/>
                </RotateTransform3D.Rotation>
            </RotateTransform3D>
            <RotateTransform3D>
                <RotateTransform3D.Rotation>
                    <AxisAngleRotation3D Axis="0,1,0" Angle="{Binding varY}"/>
                </RotateTransform3D.Rotation>
            </RotateTransform3D>
            <RotateTransform3D>
                <RotateTransform3D.Rotation>
                     <AxisAngleRotation3D Axis="0,0,1" Angle="{Binding varZ}"/>
                </RotateTransform3D.Rotation>
            </RotateTransform3D>
        </Transform3DGroup>
    </ModelVisual3D.Transform>
</ModelVisual3D>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!