如何使用Kinect旋转基于Helix的3D模型?

时间:2015-05-21 10:27:26

标签: wpf 3d kinect

我有一个基于3D的球体,正在XAML的ViewPort中开发。我为此使用了螺旋视口。

我需要做的是使用Kinect V2旋转3D模型(使用Helix Toolkit)。我能够集成KinectRegion和KinectUserViewer,并且能够在我的项目中启用正常的点击事件。

现在我需要做的是使用Kinect旋转3D模型。

请您提供解决方案吗?

这是我的代码:

<helix:HelixViewport3D  x:Name="view1"  InfiniteSpin="True" >
    <!-- Sun light -->
    <ModelVisual3D>
        <ModelVisual3D.Content>
            <Model3DGroup>
                <Model3DGroup.Children>
                    <PointLight Position="0,0,0" Color="White" />
                    <AmbientLight Color="#101010"/>
                </Model3DGroup.Children>
            </Model3DGroup>
        </ModelVisual3D.Content>
    </ModelVisual3D>
    <!-- The solar system model -->
    <wpf:SolarSystem3D DistanceScale="1e6" DiameterScale="1e3">
            <wpf:Planet3D ObjectName="Sun"
                          MeanRadius="13920"
                          RotationPeriod="25.379995"/>
            <wpf:Planet3D ObjectName="Mercury"  
                          Aphelion="0" Perifelion="0" 
                          SemiMajorAxis="57909100"
                          Eccentricity="0.205630" 
                          OrbitalPeriod="87.969 " 
                          Inclination="6.34"
                          LongitudeOfAscendingNode="48.331"
                          ArgumentOfPerihelion="29.124"
                          MeanRadius="2439.7"
                          RotationPeriod="58.6462"/>
            <wpf:Planet3D ObjectName="Venus" 
                          Aphelion="108942109"
                          Perifelion="107476259" 
                          SemiMajorAxis="108208930"
                          Eccentricity="0.0068" 
                          OrbitalPeriod="224.70069" 
                          Inclination="2.19"
                          LongitudeOfAscendingNode="76.67069"
                          ArgumentOfPerihelion="54.85229"
                          MeanRadius="6051.8"
                          RotationPeriod="-243.0187"/>
            <wpf:Planet3D ObjectName="Earth" 
                          Aphelion="152097701"
                          Perifelion="147098074" 
                          SemiMajorAxis="149597887.5"
                          Eccentricity="0.016710219" 
                          OrbitalPeriod="365.256366" 
                          Inclination="1.57869"
                          LongitudeOfAscendingNode="348.73936"
                          ArgumentOfPerihelion="114.20783"
                          MeanRadius="6371.0"
                          AxialTilt="23.439281"
                          RotationPeriod="0.99726968"
                          DistanceScale="3e4"
                          DiameterScale="1e3">
                              <wpf:Planet3D.Satellites>
                                  <wpf:Satellite3D ObjectName="Moon"
                                                   Perigee="363104"
                                                   Apogee="405696"
                                                   SemiMajorAxis="384399"
                                                   Eccentricity="0.0549"
                                                   OrbitalPeriod="27.321582"
                                                   Inclination="5.145"
                                                   MeanRadius="1737.10"
                                                   AxialTilt="6.687"
                                                   RotationPeriod="27.321582"/>
                              </wpf:Planet3D.Satellites>
            </wpf:Planet3D>
            <wpf:Planet3D ObjectName="Mars" 
                          Aphelion="0" Perifelion="0" 
                          SemiMajorAxis="227939100"
                          Eccentricity="0.093315" 
                          OrbitalPeriod="686.971" 
                          Inclination="1.67"
                          LongitudeOfAscendingNode="49.562"
                          ArgumentOfPerihelion="286.537"
                          MeanRadius="2439.7"
                          RotationPeriod="1.02595675"
                          DistanceScale="2e3"
                          DiameterScale="1e1" >
                              <wpf:Planet3D.Satellites>
                                  <wpf:Satellite3D ObjectName="Phobos"
                                                   Perigee="0"
                                                   Apogee="0"
                                                   SemiMajorAxis="9377.2" 
                                                   Eccentricity="0.0151"
                                                   OrbitalPeriod="0.31891023"
                                                   Inclination="26.04"
                                                   MeanRadius="11.1"
                                                   AxialTilt="0"
                                                   RotationPeriod="0"/>
                                  <wpf:Satellite3D ObjectName="Deimos"
                                                   Perigee="0"
                                                   Apogee="0"
                                                   SemiMajorAxis="23460"
                                                   Eccentricity="0.0002"
                                                   OrbitalPeriod="1.26244"
                                                   Inclination="27.58"
                                                   MeanRadius="6.2"
                                                   AxialTilt="0"
                                                   RotationPeriod="0"/>
                              </wpf:Planet3D.Satellites>
                        </wpf:Planet3D>
                        <wpf:Planet3D ObjectName="Jupiter" 
                                      Aphelion="0" Perifelion="0" 
                                      SemiMajorAxis="778547200"
                                      Eccentricity="0.048775" 
                                      OrbitalPeriod="4331.572" 
                                      Inclination="0.32"
                                      LongitudeOfAscendingNode="100.492"
                                      ArgumentOfPerihelion="275.066"
                                      MeanRadius="71492"
                                      RotationPeriod="0.41007"/>
                        <wpf:Planet3D ObjectName="Saturn"
                                      Aphelion="0"
                                      Perifelion="0" 
                                      SemiMajorAxis="1433449370"
                                      Eccentricity="0.055723219" 
                                      OrbitalPeriod="10759.22" 
                                      Inclination="0.93"
                                      LongitudeOfAscendingNode="113.642811"
                                      ArgumentOfPerihelion="336.013862"
                                      MeanRadius="60268"
                                      RotationPeriod="0.426">
                        </wpf:Planet3D>
                        <wpf:Planet3D ObjectName="Uranus" 
                                      Aphelion="0"
                                      Perifelion="0" 
                                      SemiMajorAxis="2876679082"
                                      Eccentricity="0.044405586" 
                                      OrbitalPeriod="30799.095" 
                                      Inclination="1.02"
                                      LongitudeOfAscendingNode="73.989821"
                                      ArgumentOfPerihelion="96.541318"
                                      MeanRadius="25559"
                                      RotationPeriod="-0.71833"/>
                        <wpf:Planet3D ObjectName="Neptune" 
                                      Aphelion="0"
                                      Perifelion="0" 
                                      SemiMajorAxis="4503443661"
                                      Eccentricity="0.011214269" 
                                      OrbitalPeriod="60190" 
                                      Inclination="0.72"
                                      LongitudeOfAscendingNode="131.794310"
                                      ArgumentOfPerihelion="265.646853"
                                      MeanRadius="24764"
                                      RotationPeriod="0.67125"/>
    </wpf:SolarSystem3D>
</helix:HelixViewport3D>

我需要使用Kinect旋转上面的代码。我已将上述代码放在网格中。

0 个答案:

没有答案