Two polygons have same texture?

New Message Reply Date view Thread view Subject view Author view

Robert Reif (reif++at++rdvax.ntsc.navy.mil)
24 Jun 98 16:44:00 EST


Hi all,

I am trying to determine if two textured polygons have had the same
texture applied to them. The polygons are in the same plane and have
the same pfTexture and pfTexEnv. The polygons may not share any vertices
so I can't just see if the texture coordinates are the same for the shared
vertices.

I am trying to figure this out by determining if the texture scale
and offset are the same for each polygon by examining the texture
coordinates. I'm doing this by rotating the polygon into the xy plane
using pfMatrix::makeVecRotVec(polygon_normal, z_axis). I then calculate
the texture scale and origin using the rotated vertex coordinates and
the texture coordinates. I assume the texture is scaled the same
in both directions and has no shear.

This only works some of the time. It appears that makeVecRotVec doesn't
always give me the proper orientation in the xy plane. Swapping the s and
t texture coordinates sometimes fixes my problem which leads me to believe
the rotation in the xy plane is sometimes wrong.

Does anyone know how to calculate a proper transformation matrix for
rotating an arbitrarily oriented polygon into the st plane?

Thanks,

Bob.

=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
            Submissions: info-performer++at++sgi.com
        Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:57:35 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.