using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
public class Sample04 : MonoBehaviour {
public GameObject target;
public float radius = 2.0f;
NtUnity.Kinect nt;
void Start () {
nt = new NtUnity.Kinect();
}
void Update () {
nt.setAudio(false);
if (nt.beamAngleConfidence < 0.5) return;
double theta = nt.beamAngle;
double x = radius * Math.Sin(theta);
float y = target.transform.position.y;
double z = radius * (-Math.Cos(theta));
target.transform.position = new Vector3((float)x,y,(float)z);
}
}
|