Example #1
0
    private void OnEnable()
    {
        this.device = Device.Open(0);
        var config = new DeviceConfiguration
        {
            ColorResolution = ColorResolution.r720p,
            ColorFormat     = ImageFormat.ColorBGRA32,
            DepthMode       = DepthMode.NFOV_Unbinned
        };

        device.StartCameras(config);

        var calibration = device.GetCalibration(config.DepthMode, config.ColorResolution);

        this.tracker = BodyTracker.Create(calibration);
        debugObjects = new GameObject[(int)JointId.Count];
        for (var i = 0; i < (int)JointId.Count; i++)
        {
            var cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
            cube.name = Enum.GetName(typeof(JointId), i);
            cube.transform.localScale = Vector3.one * 0.4f;
            debugObjects[i]           = cube;
        }

        handler.CreateNewModel();
        streamer.Start();
        //streamer.ListenForIncommingRequests();
        print("Created new handler model");
    }
Example #2
0
    //public Renderer renderer;

    private void OnEnable()
    {
        this.device = Device.Open(0);
        var config = new DeviceConfiguration
        {
            ColorResolution = ColorResolution.r720p,
            ColorFormat     = ImageFormat.ColorBGRA32,
            DepthMode       = DepthMode.NFOV_Unbinned
        };

        device.StartCameras(config);

        var calibration = device.GetCalibration(config.DepthMode, config.ColorResolution);

        var trackerConfiguration = new TrackerConfiguration {
            SensorOrientation = SensorOrientation.OrientationDefault,
            CpuOnlyMode       = false
        };

        this.tracker = BodyTracker.Create(calibration, trackerConfiguration);
        debugObjects = new GameObject[(int)JointType.Count];
        for (var i = 0; i < (int)JointType.Count; i++)
        {
            var cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
            cube.name = Enum.GetName(typeof(JointType), i);
            cube.transform.localScale = Vector3.one * 0.4f;
            debugObjects[i]           = cube;
        }
    }
Example #3
0
    void InitCamera()
    {
        this.device = Device.Open(0);
        var config = new DeviceConfiguration
        {
            ColorResolution = ColorResolution.r720p,
            ColorFormat     = ImageFormat.ColorBGRA32,
            DepthMode       = DepthMode.NFOV_Unbinned
        };

        device.StartCameras(config);

        var calibration = device.GetCalibration(config.DepthMode, config.ColorResolution);

        this.tracker = BodyTracker.Create(calibration);

        GameObject cameraFeed = GameObject.FindWithTag("CameraFeed");

        renderer = cameraFeed.GetComponent <Renderer>();
    }
Example #4
0
    private void InitCamera()
    {
        this.device = Device.Open(0);
        var config = new DeviceConfiguration
        {
            ColorResolution = ColorResolution.r720p,
            ColorFormat     = ImageFormat.ColorBGRA32,
            DepthMode       = DepthMode.NFOV_Unbinned
        };

        device.StartCameras(config);

        //declare and initialize a calibration for the camera
        var calibration = device.GetCalibration(config.DepthMode, config.ColorResolution);

        //initialize a tracker with the calibration we just made
        this.tracker = BodyTracker.Create(calibration);
        renderer     = GetComponent <Renderer>();
        canUpdate    = true;
    }