/[gzz]/gzz/test/gzz/gfx/gl/glvobcoorder.test
ViewVC logotype

Diff of /gzz/test/gzz/gfx/gl/glvobcoorder.test

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.33 by tjl, Wed Feb 5 12:32:39 2003 UTC revision 1.34 by tjl, Wed Feb 5 18:47:40 2003 UTC
# Line 91  def checkInverse(c, cs): Line 91  def checkInverse(c, cs):
91          failIf( abs(src[i] - src3[i])/(abs(src[i])+1) > 0.01, msg=msg)          failIf( abs(src[i] - src3[i])/(abs(src[i])+1) > 0.01, msg=msg)
92          failIf( abs(dst[i] - dst2[i])/(abs(dst[i])+1) > 0.01, msg=msg)          failIf( abs(dst[i] - dst2[i])/(abs(dst[i])+1) > 0.01, msg=msg)
93    
94        # As a bonus, test that the unit square is reported right
95    
96        c.getSqSize(cs, dst)
97    
98        cs1 = c.scale(cs, dst[0], dst[1], 1)
99        cs2 = c.unitSq(cs)
100    
101        c.transformPoints3(cs1, src, dst)
102        c.transformPoints3(cs2, src, dst2)
103    
104        msg = str((src, dst, dst2))
105        for i in range(0,len(src)):
106            failIf( abs(dst[i] - dst2[i])/(abs(dst[i])+1) > 0.01, msg=msg)
107    
108    
109  def testInverses():  def testInverses():
110      for i in range(0,5):      for i in range(0,5):
111          c = GLVobCoorder()          c = GLVobCoorder()
# Line 123  def testInverses(): Line 138  def testInverses():
138          cs_cull = c.cull(cs_affine, cs_affine_clip)          cs_cull = c.cull(cs_affine, cs_affine_clip)
139          checkInverse(c, cs_cull)          checkInverse(c, cs_cull)
140    
141            cs_box = c.orthoBox(0, 0, 100, 150, .2, .3, 420, 430)
142            checkInverse(c, cs_box)
143            # Now, place a nadir cs under this - it should retain
144            # the box
145            box = zeros(2, 'f')
146            c.getSqSize(cs_box, box)
147            failUnlessEqual(box[0], 420)
148            failUnlessEqual(box[1], 430)
149            cs_nadir = c.nadirUnitSq(cs_box, cs_ortho)
150            c.getSqSize(cs_nadir, box)
151            failUnlessEqual(box[0], 420)
152            failUnlessEqual(box[1], 430)
153            checkInverse(c, cs_nadir)
154            cs_nadir = c.nadirOrigin(cs_box, cs_ortho)
155            c.getSqSize(cs_nadir, box)
156            failUnlessEqual(box[0], 420)
157            failUnlessEqual(box[1], 430)
158            checkInverse(c, cs_nadir)
159    
160  def testInterpolateTranslation():  def testInterpolateTranslation():
161    

Legend:
Removed from v.1.33  
changed lines
  Added in v.1.34

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26