Esempio n. 1
0
        /// <summary>
        ///     Нахождение соответствующего пикселя на текстуре
        /// </summary>
        /// <param name="c1"></param>
        /// <param name="c2"></param>
        /// <param name="c3"></param>
        /// <param name="a"></param>
        /// <param name="b"></param>
        /// <param name="g"></param>
        /// <returns></returns>
        private Color FindTexel(Vertex2D c1, Vertex2D c2, Vertex2D c3, double a, double b, double g)
        {
            var w     = TextureMap.Width;
            var h     = TextureMap.Height;
            var u     = a * c1.U + b * c2.U + g * c3.U;
            var v     = a * (1 - c1.V) + b * (1 - c2.V) + g * (1 - c3.V);
            var texel = TextureMap.GetPixel((int)(u * w), (int)(v * h));

            return(texel);
        }