コード例 #1
0
        void Update()
        {
            if (_KinectSensor != null)
            {
                if (_KinectSensor.RawDepthImage != null)
                {
                    short[] depthImage = _KinectSensor.RawDepthImage;
                    System.Buffer.BlockCopy(depthImage, 0, _DepthRawData, 0, _DepthRawData.Length);

                    // _PointCloudRenderer.UpdateColorTexture(_KinectSensor.TransformedColorImage);
                    _PointCloudRenderer.UpdateDepthTexture(_DepthRawData);
                }

                System.Numerics.Vector3 accel = _KinectSensor.ImuSample.AccelerometerSample;
                if (LowPassFilter)
                {
                    _Accel[0] = accel.X;
                    _Accel[1] = accel.Y;
                    _Accel[2] = accel.Z;
                    _LowPassFilter.Apply(_Accel, ref _AccelOut);
                    accel.X = _AccelOut[0];
                    accel.Y = _AccelOut[1];
                    accel.Z = _AccelOut[2];
                }

                UnityEngine.Vector3 kinectOrientation = OrientationEstimator.EstimateForAzureKinect(accel);

                this.transform.eulerAngles = kinectOrientation;
            }
        }
コード例 #2
0
        void Update()
        {
            _KinectSensor = _AzureKinectManager.SensorList[_DeviceNumber];
            if (_KinectSensor != null)
            {
                if (_KinectSensor.RawDepthImage != null)
                {
                    short[] depthImage = _KinectSensor.RawDepthImage;
                    System.Buffer.BlockCopy(depthImage, 0, _DepthRawData, 0, _DepthRawData.Length);

                    _PointCloudRenderer.UpdateColorTexture(_KinectSensor.TransformedColorImage);
                    _PointCloudRenderer.UpdateDepthTexture(_DepthRawData);
                }
            }
        }