예제 #1
0
        public static (double u, double v) CubicalMap(Point p)
        {
            var face = CubeMapPattern.FaceFromPoint(p);

            (double u, double v)uv;

            switch (face)
            {
            case CubeFace.Left:
                uv = CubeMapPattern.CubeUVLeft(p);
                break;

            case CubeFace.Right:
                uv = CubeMapPattern.CubeUVRight(p);
                break;

            case CubeFace.Front:
                uv = CubeMapPattern.CubeUVFront(p);
                break;

            case CubeFace.Back:
                uv = CubeMapPattern.CubeUVBack(p);
                break;

            case CubeFace.Up:
                uv = CubeMapPattern.CubeUVUpper(p);
                break;

            case CubeFace.Down:
                uv = CubeMapPattern.CubeUVLower(p);
                break;

            default:
                uv = (0, 0);
                break;
            }

            return(uv);
        }
예제 #2
0
        public override Color PatternAt(Point p)
        {
            var uv = UVMap(p);

            return(_pattern.UVPatternAt(uv.u, uv.v, _mapping == Mapping.Cubical ? CubeMapPattern.FaceFromPoint(p) : CubeFace.None));
        }