POV-Ray : Newsgroups : povray.off-topic : Memories : Re: Memories Server Time
30 Jul 2024 00:20:58 EDT (-0400)
  Re: Memories  
From: Warp
Date: 20 Aug 2011 14:55:57
Message: <4e50033d@news.povray.org>
Orchid XP v8 <voi### [at] devnull> wrote:
> The slanted area cut by the line actually has the same area as a 
> rectangle with the same center hieght. (This is why the trapezoidal rule 
> for numerical integration works.)

  That takes care of the situation where the edge of the line crosses the
opposite sides of the pixel. However, you have to take into account
separately the cases where the edge crosses two adjacent sides of the pixel
(in which case the cross-section is a triangle rather than a trapezoid).
And of course the triangle can be either the inside or the outside of the
line, so that has to be taken into account.

  Then there's the special case where *both* edges of the line cross the
*same* pixel. This can happen even if the line width is that of one pixel,
when the line crosses the pixel diagonally (but can also more obviously
happen when the width of the line is less than a pixel). In this case you
have to calculate the area covered by one edge, then the area *not* covered
by the other and subtract them.

  So no, you don't get it "almost for free". Not if you want a high degree
of accuracy.

> A more "interesting" problem is what happens when multiple 
> different-coloured lines overlap...

  What's the problem in that? Just draw them one at a time (taking the
transparency of the antialiased pixels into account).

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.