Ejemplo n.º 1
0
        private void PaintCubePart(CubePart part, SmallCube model, Color[] colorMap)
        {
            for (var side = CubeSide.Left; side <= CubeSide.Back; side++)
            {
                Triangle[] sidePolygons = part[side];
                Color      sideColor    = colorMap[model[side]];

                for (int j = 0; j < sidePolygons.Length; j++)
                {
                    sidePolygons[j].Color = sideColor;
                }
            }
        }
Ejemplo n.º 2
0
        private bool IsSideContainsPoint(CubePart cubePart, CubeSide side, Vector3 point,
                                         Scene scene, Matrix worldViewProjection)
        {
            foreach (Triangle polygon in cubePart[side])
            {
                if (IsTriangleContainsPoint(polygon, point, scene, worldViewProjection))
                {
                    return(true);
                }
            }

            return(false);
        }