Venerable Vampire> what he means by splitting is:
- get the top and bottom vertices...
the remaining vert then is the one between the two others.
- top vertex is called v0, middle vertex v1, and the bottom vertex v2.
- compute interpolation gradients for v0 -> v2 and v0 -> 1.
- draw the first half of the triangle (sub-triangle 1, from the top to the middle vertex), interpolating X and other stuff like color, texcoords, normals, whatever..
** here, you have a scanline missing **
- compute interpolation gradient for v1 -> v2, re-use gradient and current interpolation counter from v0 -> v2.
- draw the second half of the triangle (sub-triangle 2, from the middle to the bottom vertex)
and you can throw away part1 or part2 if v0.y == v1.y or v1.y == v2.y
haro> dunno.. he probably uses an edge list. and that missing scanline bug also appears in edge lists, it's just that he stops along the v0->v1 line too early, and probably only has one value filled in the edge list at that Y where the missing scanline is...
EDIT: btw, the edge list is more general than the triangle split where you draw everything in one go, it can handle tris, quads, n-gons, and with some modifications even non convex / hollowed polys, but the split method is usually faster.
[edited by - sBibi on May 30, 2004 7:16:48 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement