###前提・実現したいこと
unityでkinect v2を使用し、顔のメッシュを取得して表示するプログラムを作っています。
変数の初期化を行う際に以下のエラーが発生しました。
###発生している問題・エラーメッセージ
エラーメッセージ Assets/Script/DynamicCreateMesh_test.cs(23,46): error CS0122: `Microsoft.Kinect.Face.HighDefinitionFaceFrameSource.HighDefinitionFaceFrameSource(System.IntPtr)' is inaccessible due to its protection level Assets/Script/DynamicCreateMesh_test.cs(26,33): error CS1729: The type `Microsoft.Kinect.Face.FaceModel' does not contain a constructor that takes `0' arguments Assets/Script/DynamicCreateMesh_test.cs(27,37): error CS1729: The type `Microsoft.Kinect.Face.FaceAlignment' does not contain a constructor that takes `0' arguments
###該当のソースコード
C#
1using System.Collections; 2using System.Collections.Generic; 3using UnityEngine; 4using Windows.Kinect; 5using Microsoft.Kinect.Face; 6 7[RequireComponent(typeof(MeshRenderer))] 8[RequireComponent(typeof(MeshFilter))] 9public class DynamicCreateMesh_test: MonoBehaviour 10{ 11 //create mesh dynamically 12 private KinectSensor kinect; 13 14 private FaceAlignment currentFaceAlignment = null; 15 private FaceModel currentFaceModel = null; 16 private HighDefinitionFaceFrameSource highDefinitionFaceFrameSource = null; 17 private HighDefinitionFaceFrameReader highDefinitionFaceFrameReader = null; 18 19 private void InitializeHDFace() 20 { 21 this.kinect = KinectSensor.GetDefault(); 22 23 this.highDefinitionFaceFrameSource = new HighDefinitionFaceFrameSource(this.kinect); 24 this.highDefinitionFaceFrameReader = this.highDefinitionFaceFrameSource.OpenReader(); 25 26 this.currentFaceModel = new FaceModel(); 27 this.currentFaceAlignment = new FaceAlignment(); 28 29 this.InitializeMesh(); 30 31 this.kinect.Open(); 32 } 33 34 private void InitializeMesh() 35 { 36 var vertices = this.currentFaceModel.CalculateVerticesForAlignment(this.currentFaceAlignment); 37 Debug.Log(vertices); 38 } 39 40 private void Start() 41 { 42 InitializeHDFace(); 43 } 44} 45
###補足情報(言語/FW/ツール等のバージョンなど)
unity5.5
kinect sdk 2.0
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/01/16 01:10