From: <mbaas@us...>  20061128 09:13:29

Revision: 173 http://svn.sourceforge.net/cgkit/?rev=173&view=rev Author: mbaas Date: 20061128 01:13:28 0800 (Tue, 28 Nov 2006) Log Message:  1) translation() was only accepting vec3 as input. 2) perspective() was still using frustum() as a nonstatic method. 3) orthographic() was entirely broken because of 'typos'. 4) lookAt() was modifying self (which is different to the regular version). Modified Paths:  cgkit/trunk/cgkit/light/cgtypes/mat4.py Modified: cgkit/trunk/cgkit/light/cgtypes/mat4.py ===================================================================  cgkit/trunk/cgkit/light/cgtypes/mat4.py 20061128 09:11:18 UTC (rev 172) +++ cgkit/trunk/cgkit/light/cgtypes/mat4.py 20061128 09:13:28 UTC (rev 173) @@ 539,9 +539,10 @@ def translation(t): """Return translation matrix."""  return mat4(1.0, 0.0, 0.0, t.x,  0.0, 1.0, 0.0, t.y,  0.0, 0.0, 1.0, t.z, + tx,ty,tz = t + return mat4(1.0, 0.0, 0.0, tx, + 0.0, 1.0, 0.0, ty, + 0.0, 0.0, 1.0, tz, 0.0, 0.0, 0.0, 1.0) translation = staticmethod(translation) @@ 645,7 +646,7 @@ left = bottom * aspect right = top * aspect  return self.frustum(left, right, bottom, top, near, far) + return mat4.frustum(left, right, bottom, top, near, far) perspective = staticmethod(perspective) def orthographic(left, right, bottom, top, near, far): @@ 657,7 +658,7 @@ r_l = float(rightleft) t_b = float(topbottom)  f_n = float(farvalnearval) + f_n = float(farnear) if r_l<=_epsilon: raise ValueError, "rightvalue must be greater than leftvalue"; @@ 668,7 +669,7 @@ return mat4(2.0/r_l, 0.0, 0.0, (right+left)/r_l, 0.0, 2.0/t_b, 0.0, (top+bottom)/t_b,  0.0, 0.0, 2.0/f_n, (farval+nearval)/f_n, + 0.0, 0.0, 2.0/f_n, (far+near)/f_n, 0.0, 0.0, 0.0, 1.0) orthographic = staticmethod(orthographic) @@ 676,7 +677,7 @@ """Look from pos to target. The resulting transformation moves the origin to pos and  rotates so that The zaxis points to target. The yaxis is + rotates so that the zaxis points to target. The yaxis is as close as possible to the up vector. """ pos = _vec3(pos) @@ 695,11 +696,10 @@ right = up.cross(dir).normalize()  self.mlist=[right.x, up.x, dir.x, pos.x, + return mat4(right.x, up.x, dir.x, pos.x, right.y, up.y, dir.y, pos.y, right.z, up.z, dir.z, pos.z,  0.0, 0.0, 0.0, 1.0]  return self + 0.0, 0.0, 0.0, 1.0) lookAt = staticmethod(lookAt) def ortho(self): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 