public void Init(KinectFrame frame, KinectCameraInfo cameraInfo)
        {
            _initialized = true;

            // store variables
            _xRes = cameraInfo.XRes;
            _yRes = cameraInfo.YRes;

            _focalLengthImage = (float)cameraInfo.FocalLengthImage;
            _focalLengthDepth = (float)cameraInfo.FocalLengthDetph;
            _depthToRgb       = cameraInfo.DepthToRgb;

            CreateVertexBuffer();
            CreateIndexBuffer();
            CreateTextures();

            _light = new DxLight
            {
                Type        = DxLightType.None,
                Position    = new Vector3(0, 0, 0f),
                Direction   = new Vector3(0, 0, 1),
                Ambient     = new Vector4(0.4f, 0.4f, 0.4f, 1.0f),
                Diffuse     = new Vector4(1.0f, 1.0f, 1.0f, 1.0f),
                Specular    = new Vector4(1.0f, 1.0f, 1.0f, 1.0f),
                Attenuation = new Vector3(0.0f, 0.005f, 0.0f),
                SpotPower   = 0.001f,
                Range       = 1000f
            };
        }
Esempio n. 2
0
        public DxLight GetLight()
        {
            DxLight light = new DxLight
            {
                Type        = LightType,
                Position    = Position.ToVector3(),
                Direction   = Direction.ToVector3(),
                Ambient     = Ambient.ToVector4(),
                Diffuse     = Diffuse.ToVector4(),
                Specular    = Specular.ToVector4(),
                Attenuation = new Vector3(0.0f, 0.005f, 0.0f),
                SpotPower   = 0.001f,
                Range       = 1000f
            };

            return(light);
        }
        public void Init(KinectFrame frame, KinectCameraInfo cameraInfo)
        {
            _initialized = true;

            // store variables
            _xRes = cameraInfo.XRes;
            _yRes = cameraInfo.YRes;

            _focalLengthImage = (float)cameraInfo.FocalLengthImage;
            _focalLengthDepth = (float)cameraInfo.FocalLengthDetph;
            _depthToRgb = cameraInfo.DepthToRgb;

            CreateVertexBuffer();
            CreateIndexBuffer();
            CreateTextures();

            _light = new DxLight
            {
                Type = DxLightType.None,
                Position = new Vector3(0, 0, 0f),
                Direction = new Vector3(0, 0, 1),
                Ambient = new Vector4(0.4f, 0.4f, 0.4f, 1.0f),
                Diffuse = new Vector4(1.0f, 1.0f, 1.0f, 1.0f),
                Specular = new Vector4(1.0f, 1.0f, 1.0f, 1.0f),
                Attenuation = new Vector3(0.0f, 0.005f, 0.0f),
                SpotPower = 0.001f,
                Range = 1000f
            };
        }
 public DxLight GetLight()
 {
     DxLight light = new DxLight
                         {
                             Type = LightType,
                             Position = Position.ToVector3(),
                             Direction = Direction.ToVector3(),
                             Ambient = Ambient.ToVector4(),
                             Diffuse = Diffuse.ToVector4(),
                             Specular = Specular.ToVector4(),
                             Attenuation = new Vector3(0.0f, 0.005f, 0.0f),
                             SpotPower = 0.001f,
                             Range = 1000f
                         };
     return light;
 }