Re: Two polygons have same texture?

New Message Reply Date view Thread view Subject view Author view

Angus Dorbie (dorbie++at++sgi.com)
Wed, 24 Jun 1998 14:30:10 -0700


Sounds like you need to check the texture derivatives.

Figure out what the delta s and delta t vectors are and compare
them for each polygon. You should also check that the s or t
coordinates produced by the plane equation defined by this
vector and the value of s&t at a vertex match the other polygon
s&t values for one vertex.

Cheers,Angus.

Robert Reif wrote:
>
> 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

-- 
"Only the mediocre are always at their best." -- Jean Giraudoux 

For advanced 3D graphics Performer + OpenGL based examples and tutors: http://www.dorbie.com/ ======================================================================= 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.