[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz/gfx/libpaper texcoords.py
From: |
Tuomas J. Lukka |
Subject: |
[Gzz-commits] gzz/gfx/libpaper texcoords.py |
Date: |
Sat, 31 Aug 2002 01:43:33 -0400 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Tuomas J. Lukka <address@hidden> 02/08/31 01:43:33
Modified files:
gfx/libpaper : texcoords.py
Log message:
Make an object
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libpaper/texcoords.py.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
Patches:
Index: gzz/gfx/libpaper/texcoords.py
diff -c gzz/gfx/libpaper/texcoords.py:1.2 gzz/gfx/libpaper/texcoords.py:1.3
*** gzz/gfx/libpaper/texcoords.py:1.2 Sat Aug 31 01:42:32 2002
--- gzz/gfx/libpaper/texcoords.py Sat Aug 31 01:43:33 2002
***************
*** 1,7 ****
# Texture coordinates
class TexCoords:
! def _create2DXYVectors(rnd):
"""Create the carefully correlated matrix which gives (x,y)
from the texture coordinates (s,t).
--- 1,7 ----
# Texture coordinates
class TexCoords:
! def _create2DXYVectors(self, rnd):
"""Create the carefully correlated matrix which gives (x,y)
from the texture coordinates (s,t).
***************
*** 44,50 ****
return mat
! def _invert2Dsimple(mat):
"""Invert 2 4D vectors given by _create2DXYVectors to get the vectors
to dot (x,y,0,1) with to get (s,t)
"""
--- 44,50 ----
return mat
! def _invert2Dsimple(self, mat):
"""Invert 2 4D vectors given by _create2DXYVectors to get the vectors
to dot (x,y,0,1) with to get (s,t)
"""
***************
*** 61,67 ****
return r
! def _create3DPlane(rnd):
"""Get a suitable vector for a plane inside a 3D texture.
Returns a 4-component vector; the equation is
--- 61,67 ----
return r
! def _create3DPlane(self, rnd):
"""Get a suitable vector for a plane inside a 3D texture.
Returns a 4-component vector; the equation is
***************
*** 82,88 ****
return (i, j, k, shift)
! def _3DPlaneOrthoVecs(v):
"""From a 4-vector (a,b,c,d) describing a plane, create two orthonormal
3-vectors plus one 3-offset vector which mean
(s3,t3,r3) = v_1*s2 + v_2*t2 + v_3 where
--- 82,88 ----
return (i, j, k, shift)
! def _3DPlaneOrthoVecs(self, v):
"""From a 4-vector (a,b,c,d) describing a plane, create two orthonormal
3-vectors plus one 3-offset vector which mean
(s3,t3,r3) = v_1*s2 + v_2*t2 + v_3 where
***************
*** 123,133 ****
return (vec1, vec2, vec3)
! def get2DTexGenData(rnd):
"""Get the data to pass to texgen for a single, random
2D texture coordinate system.
"""
! vectors = _invert2Dsimple(_create2DXYVectors(rnd))
return [
vectors[0][0],
vectors[0][1],
--- 123,133 ----
return (vec1, vec2, vec3)
! def get2DTexGenData(self, rnd):
"""Get the data to pass to texgen for a single, random
2D texture coordinate system.
"""
! vectors = self._invert2Dsimple(self._create2DXYVectors(rnd))
return [
vectors[0][0],
vectors[0][1],
***************
*** 140,156 ****
0, 0, 0, 0
]
! def get3DTexGenData(rnd):
"""Get the data to pass to texgen for a single, random
2D slice of a 3D texture coordinate system.
"""
# Get the transformation from (x,y,z) to
# the virtual 2D texture coordinates (s2, t2)
! vectors = _invert2Dsimple(_create2DXYVectors(rnd))
# Then, create the transformation from (s2, t3)
# to (s3, t3, r3)
! planevec = _create3DPlane(rnd)
# And finally, concatenate the two by matrix
# multiplication
--- 140,156 ----
0, 0, 0, 0
]
! def get3DTexGenData(self, rnd):
"""Get the data to pass to texgen for a single, random
2D slice of a 3D texture coordinate system.
"""
# Get the transformation from (x,y,z) to
# the virtual 2D texture coordinates (s2, t2)
! vectors = self._invert2Dsimple(self._create2DXYVectors(rnd))
# Then, create the transformation from (s2, t3)
# to (s3, t3, r3)
! planevec = self._create3DPlane(rnd)
# And finally, concatenate the two by matrix
# multiplication
***************
*** 180,186 ****
vectors[2][3],
]
! def getCorrelatedTexGenData(tg, rnd):
sca = 0.07
return [
tg[0],
--- 180,186 ----
vectors[2][3],
]
! def getCorrelatedTexGenData(self, tg, rnd):
sca = 0.07
return [
tg[0],
- [Gzz-commits] gzz/gfx/libpaper texcoords.py,
Tuomas J. Lukka <=