POV-Ray : Newsgroups : povray.off-topic : Memories : Re: Memories Server Time
30 Jul 2024 00:20:09 EDT (-0400)
  Re: Memories  
From: Warp
Date: 20 Aug 2011 08:40:32
Message: <4e4fab40@news.povray.org>
Orchid XP v8 <voi### [at] devnull> wrote:
> In the simple case of lines beginning and ending on pixel boundaries, 
> it's pretty easy.

  How so?

  Ok, maybe if you assume each pixel to be a circle (instead of a square)
it would become simply calculating the distance between the (edge of the)
line and the center of the pixel. That might work as a quite accurate
approximation.

  However, since pixels are squares, not circles, and if you want a very
accurate antialiasing, you would have to calculate how much of the square
is covered by the line. I'm not aware of a very trivial way of doing that.
(I'm not saying it's *complicated*. I'm saying it's *not trivial*, like
eg. a simple one-liner.)

> On the other hand, if you want lines that begin and end at fractional 
> coordinates, or have rounded ends or whatever, the problem becames far 
> more complicated.

  The ends of the line, especially if the line is wider than one pixel
(and especially if you use antialiasing) become a quite ambiguous problem.
Should the line be essentially a rectangle? Or two circles joined by a
rectangle? What if you draw two consecutive lines, what should the joint
point look like?

-- 
                                                          - Warp


Post a reply to this message

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