/[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.10 by tjl, Tue Oct 15 15:00:38 2002 UTC revision 1.11 by tjl, Sat Oct 19 14:29:54 2002 UTC
# Line 10  def checkTrans(c, cs, srclist, dstlist, Line 10  def checkTrans(c, cs, srclist, dstlist,
10      for i in range(0, len(src)):      for i in range(0, len(src)):
11          failIf(abs(dst[i]-dstlist[i]) > delta, str([srclist, dstlist, dst, i, dst[i], dstlist[i]]))          failIf(abs(dst[i]-dstlist[i]) > delta, str([srclist, dstlist, dst, i, dst[i], dstlist[i]]))
12    
13    def checkInterp(c1, c2, i, fract, cs, srclist, dstlist, delta=0):
14        src = array(srclist, 'f')
15        dst = zeros(len(src), 'f')
16        failUnless(c1.transformPoints3_interp(i, c2, fract, 0, cs, src, dst))
17        for i in range(0, len(src)):
18            failIf(abs(dst[i]-dstlist[i]) > delta, str([srclist, dstlist, dst, i, dst[i], dstlist[i]]))
19    
20    
21  def testTransform():  def testTransform():
22      c = GLVobCoorder()      c = GLVobCoorder()
# Line 84  def testInverses(): Line 91  def testInverses():
91    
92          checkInverse(c, cs_dist)          checkInverse(c, cs_dist)
93    
94    interp = zeros(1000, 'i')
95    interp[0] = 999
96    c1 = GLVobCoorder()
97    c2 = GLVobCoorder()
98    
99    def testInterpolateTranslation():
100    
101        cs_trans1 = c1.translate(0, 10, 10)
102        cs_trans2 = c2.translate(0, 100, 20)
103    
104        interp[cs_trans1] = cs_trans2
105        checkInterp(c1, c2, interp, .5, cs_trans1,
106            [0, 0, 0],
107            [55, 15, 0]
108        )
109    
110    def testInterpolateBuoy():
111    
112        cs_anchor = c1.translate(0, 10, 0)
113        cs_b1 = c1.buoyOnCircle(0, cs_anchor, 0, 0, 20, -20, 0, 1)
114    
115        checkTrans(c1, cs_b1,
116            [0, 0, 0],
117            [20, 0, 0],
118            .1)
119    
120        cs_b2t = c2.affineCoordsys(0, 0, 200, 200, 1, 0, 0, 1)
121        interp[cs_b1] = cs_b2t
122    
123        checkInterp(c1, c2, interp, .5, cs_b1,
124            [0, 0, 0],
125            [110, 100, 0],
126            .1)

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

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