View Single Post
02-15-07, 01:37 AM   #2
Iriel
Super Moderator
WoWInterface Super Mod
Featured
Join Date: Jun 2005
Posts: 578
This is a bit tricky, and how useful it is to you depends heavily on the textures you're using. We've basically got three tricks we can do using SetTexCoord to render any kind of curve section:

1) We can crop a sub-rectangle out of a texture image -- this is fairly obvious, you can draw any sub-rectangle of your texture image and map it to any sized rectangle on screen (A Texure object), so for the bulk of a large curve you can generally just find a rectangular area (or possibly a few rectangular areas) that needs to be shown, and display subsets as necessary that merge together into the curve.

For StatRings this does most of the work, except for the angled cut-off point.. You end up with a rectangular cut-out.

2) We can stretch a texture image to different heights/widths, specifically a 45 degree right-angled-triangular texture can be stretched to be any angle of right angled triangle, great for filling in angled edges of larger objects.

3) We can do some interesting things with images that have transparent borders, such that we can perform almost any linear transformation including shearing and rotating. This can be used to create little wedge shaped pieces for very small curve sections.

Finally you can combine several of the above, for example you could approximate a smooth edge of a very detailed texture with a bunch of rectangular sections, combined with perhaps some triangular pieces to smooth off the edge.

Finally, a couple of diagrams I drew on how to do pie charts using textures may help also:

http://www.vigilance-committee.org/w...m/PieParts.gif
http://www.vigilance-committee.org/w...m/PieShear.gif
  Reply With Quote