HandyGM wrote: ...
o For any point on the surface of the triangle, the pixel displayed is a linear blending of the texture coordinates of the 3 points of the triangle, you'll find an equation in the OpenGL spec for how that math works
Ah, there's the point I don't get. Do you have a link to the spot in the spec where this is discussed?
px - ax = S( Bx-Ax ) + T( Cx-Bx ) py - ay = S( By-Ay ) + T( Cy-By )
+ for each tessellated triangle
# for imagewidth in texture coordinate triangle width:
* for imageheight in texture coordinate
triangle height:
o test if
imagewidth+pixel,imageheight+pixel
is within coordinate triangle
+ if it is:
# take a linear blend of
the 3D points of the
triangle with the
weights for the texture
coordinates
o So, for each pixel
That 'linear blend of the 3d points of the triangle with the weights for the texture coordinates' is the bit that's balking me. I can see how this loop would work, I just don't know the algorithm for assigning an XYZ point to the pixel.
P = A + S( AB ) + T( BC )
Good luck, Mike
-- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com