Exemplo n.º 1
0
    public override void Paint(VoxelGrid canvas, VectorQueue points)
    {
        if (points.Count < 2)
        {
            return;
        }

        Vector3 p0;
        Vector3 p3;
        Vector3 start;
        Vector3 end;

        for (int i = 0; i < points.Count - 1; i++)
        {
            p0    = points[i == 0 ? 0 : i - 1];
            p3    = points[i == points.Count - 2 ? i + 1 : i + 2];
            start = points[i];

            for (float j = step; j < 1; j += step)
            {
                end = spline.Lerp(p0, points[i], points[i + 1], p3, j);
                canvas.DrawLine(start, end, pressure);
                start = end;
            }

            canvas.DrawLine(start, points[i + 1], pressure);
        }
    }
Exemplo n.º 2
0
    public override void Paint(VoxelGrid canvas, VectorQueue points)
    {
        if (points.Count == 0)
        {
            return;
        }

        canvas.DrawVoxel(points[points.Count - 1], pressure);
    }
Exemplo n.º 3
0
 /**
  * @brief Called to apply this brush.
  * @param canvas the VoxelGrid to paint on.
  * @param points the set of points to stroke.
  */
 public abstract void Paint(VoxelGrid canvas, VectorQueue points);