Hello,
I'm having some problems in drawing triangles.

I'm using DirectFB 1.4.1 on a powerPC based system, with a Fujitsu Carmine gpu.
I have a gfx driver function to draw triangles using the gpu.
I'm finding something strange when the triangle need to be clipped.

If the triangle lies partially outside the clipping region and one of
the vertex of the clipping region is inside the triangle area, the
clipping algorithm shoud take this vertex of the clipping region as
one of the vertex of the triangles which will be drawn to rebuild the
clipped triangle. Instead, it seems that the clipping algorithm does
not consider this point and uses only the intersection of the triangle
edges and the clipping region edges.

This algorithm is in clip.c, dfb_clip_triangle().

I checked in that function if the vertexes of the clipping region are
in the triangle I want to draw and I added that vertex in the list of
vertices that will be used to draw the triangles.
This works almost well, but some times it happens that the triangles
drawn don't cover the entire area (it seems that the vertex chosen as
pivot to drawn the triangles is wong).

Anyway, since I have very short time to make the things work, I add a
control that check if the triangle I want to draw needs to be clipped,
and if it do, I don't use the hw accelerate triangle drawing function
but the spanline rasterizer (fill the triangle using a rectangle for
each spanline).

Does anyone find any problem about this triangle clipping issue?
Thank you

Matteo Canella
_______________________________________________
directfb-dev mailing list
directfb-dev@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to