Re: Texel area

Manuel Massing <[email protected]> Fri, 4 Feb 2011 20:44:15 +0100
Newsgroups gmane.games.devel.algorithms
Message-ID <[email protected]>
Hi Diogo,

> - triangle T=(V1,V2,V3), in which V1, V2, V3 are vertexes that have some
> properties (world space position, normal, diffuse color, texture
> coordinates 0 (in uniform space), texture coordinates 1 (in texture space,
> [0..texture size[), etc),
> 
> - texture size
> 
> - position inside the triangle (absolute value in texture space)
> 
> 
> 
> is to find out the rectangle that bounds the texel in world space (origin+2
> vectors)...

if I understand your setup correctly, you're dealing with a linear transform
(from a plane in UV-space to a plane in world space), so the partial 
derivatives with respect to u and v are constants across the triangle.

If this is not too much setup overhead, you could proceed by finding the world
space directions U and V corresponding to the u/v axes for the triangle
by solving for a 3x2 matrix with the world-space-directions U and V as
columns:

matrix(U V) * (A-B) = A.worldpos - B.worldpos
matrix(U V) * (B-C) = B.worldpos - C.worldpos

where A, B are 2D u/v coordinates (in pixel units). 

cheers,

	Manuel

------------------------------------------------------------------------------
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world? 
http://p.sf.net/sfu/oracle-sfdevnlfb

_______________________________________________
GDAlgorithms-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list