Kinectの本体を上下させる
camera.ElevationAngleプロパティをいじる。
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Media; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using Microsoft.Research.Kinect.Nui; namespace WpfApplication1 { /// <summary> /// MainWindow.xaml の相互作用ロジック /// </summary> public partial class MainWindow : Window { // kinect sensor Runtime nui; // for moving Camera camera; public MainWindow() { InitializeComponent(); } private void Window_Loaded(object sender, RoutedEventArgs e) { nui = new Runtime(); try { // init runtime nui.Initialize(RuntimeOptions.UseColor); // set camera camera = nui.NuiCamera; } catch (InvalidOperationException) { MessageBox.Show("Error"); return; } } private void Window_Closed(object sender, EventArgs e) { nui.Uninitialize(); } private void upButton_Click(object sender, RoutedEventArgs e) { try { //カメラの角度を増加 camera.ElevationAngle += 5; } catch (InvalidOperationException) { return; } } private void downButton_Click(object sender, RoutedEventArgs e) { try { //カメラの角度を減少 camera.ElevationAngle -= 5; } catch (InvalidOperationException) { return; } } } }