[Interest] Filling a 3-Color Triangle - A Better Way?

Ian Thomson Ian.Thomson at iongeo.com
Thu Jul 5 17:20:42 CEST 2012

On 05/07/12 16:12, Josiah Bryan wrote:
> So, my Qt friends, is there a better way to fill a triangle with a color
> specified for each vertex, interpolated across the triangle? Some method
> that takes *less* than 4 milliseconds *per triangle*? Did I just miss
> something in the Qt gradient routines that would do this quite easily?
> Any ideas?

You might want to draw your triangles on to a QImage, using 
QImage::scanLine to manipulate the pixels directly, and then put the 
QImage on to the QWidget at the end. I would imagine this would be 
faster than QPainter::fillRect.


More information about the Interest mailing list