Board index » delphi » Algorithm for painting a quadrangle

Algorithm for painting a quadrangle

Hi all,
I'm looking for an algorithm, that paints a quadrangle, but without
dividing it into two triangles (very important). Perhaps you can even
send me some code.
Thanks, Philipp
 

Re:Algorithm for painting a quadrangle


What is wrong with triangles as long as they have the same color ?

Rene

Quote
Philipp Crocoll wrote:

> Hi all,
> I'm looking for an algorithm, that paints a quadrangle, but without
> dividing it into two triangles (very important). Perhaps you can even
> send me some code.

Re:Algorithm for painting a quadrangle


I'm writing my own little 3d-graphics-engine. Perhaps it sounds strange, I
don't want to use D3D or OpenGl. I would have a much faster texture-mapping
if I could paint the quadrangle as a whole.

Philipp

Rene Tschaggelar schrieb:

Quote
> What is wrong with triangles as long as they have the same color ?

> Rene

> Philipp Crocoll wrote:

> > Hi all,
> > I'm looking for an algorithm, that paints a quadrangle, but without
> > dividing it into two triangles (very important). Perhaps you can even
> > send me some code.

Re:Algorithm for painting a quadrangle


Quote
Philipp Crocoll <philipp.croc...@gmx.de> wrote in message

news:37A6B84E.4135714C@gmx.de...

Quote
> I'm looking for an algorithm, that paints a quadrangle, but without
> dividing it into two triangles (very important). Perhaps you can even
> send me some code.

Do you know about the TCanvas FloodFill method?

___
efg

Earl F. Glynn     E-Mail:  EarlGl...@att.net
Overland Park, KS  USA

efg's Computer Lab:  http://www.efg2.com/Lab

Re:Algorithm for painting a quadrangle


As every pixel gets an other color, I can't use it.

Re:Algorithm for painting a quadrangle


On Tue, 03 Aug 1999 16:34:30 +0200, Philipp Crocoll

Quote
<philipp.croc...@gmx.de> wrote:
>I would have a much faster texture-mapping if I could paint the
>quadrangle as a whole.

Not necessarily. If you have a good triangle-mapping algorithm,
applying it twice could easily be faster than applying a
quadrangle-mapping algorithm once, since the triangle-mapping
algorithm would be significantly simpler to implement.

-Steve

Re:Algorithm for painting a quadrangle


You're having 4 corners (x1,y1), (x2,y2), (x3,y3), (x4,y4).
By applying linear equations you can get start and endpoint of
the horizontal lines within (scanlines).
Unless the boundaryline is horizontal, each pixel of the
boundaryline is either start or endpoint of the scanline within.

Rene
--
Ing.Buero R.Tschaggelar - http://www.ibrtses.com

Quote
Philipp Crocoll wrote:

> Hi all,
> I'm looking for an algorithm, that paints a quadrangle, but without
> dividing it into two triangles (very important). Perhaps you can even
> send me some code.
> Thanks, Philipp

Re:Algorithm for painting a quadrangle


Thanks, that's what I wanted.

Other Threads