http://GameProgrammer.Com

Programming

GP Mailing List
     Thread Index
     Date Index

ATXGPSIG List
     Thread Index
     Date Index

Google
>

Home

TheGrumpyProgrammer



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Drawing Sliced Triangles



I've been able to find info on clipping, and info on drawing triangles, but
I haven't been able to find any info on drawing clipped triangles. After
snipping a triangular surface at the view frustum, how can I draw it? It's
possible that I could draw the resulting shape with a general n-sided shape
drawing routine, or I could tesselate the shape into smaller triangles. The
first is complicated, and the latter seems inefficient, particularly with
low resolutions where the result is many tiny slices. I wanted to extend my
triangle-drawing routine to understand how to deal with clipped points.
Since points clipped against the left side of the frustum, for example,
should be on the left side of the screen, their horizontal screen
coordinates are irrelevant and can therefore be discarded. It doesn't make
sense to use this clipped side as an ordinary arbitrary edge, since it's
known to be vertical and to lay along the left side of the screen. The
shape is still a triangle - sort of - only with vertical and horizontal
slices cut out of it. Now I'm having big troubles trying to implement this
idea with multiple clipping planes (I don't know how or where to store
which points are clipped and which aren't), and I'm having an even worse
time trying to draw the resulting sushified triangles efficiently. If
anyone knows of any sources of information on how to do this or other ways
in which it is accomplished in other engines, could you please post a link
or some info?

-- Neil Edelman
-- ICQ UIN: 705130
-- email: mailto:dreaded.neil@phreaker.net?subject=sig
-- home: http://members.xoom.com/dreadedneil
-- moop: http://moop.bizland.com
-- "My air-to-air missile overrides your air traffic control clearance"
=================================================================
The GameProgrammer.Com mailing list is for the open discussion
of any topic related to the art, science, and business of
programming games. This list is especially tolerant of beginners.
We were all beginners once

To SUBSCRIBE or UNSUBSCRIBE please visit:
http://gameprogrammer.com/mailinglist.html