Author: ArcRiley
Date: 2008-07-15 15:20:06 -0400 (Tue, 15 Jul 2008)
New Revision: 1318

Modified:
   trunk/pysoy/src/scenes/Landscape.pym
Log:
Ticket #929 :
 * guides for next step in heightmap generation


Modified: trunk/pysoy/src/scenes/Landscape.pym
===================================================================
--- trunk/pysoy/src/scenes/Landscape.pym        2008-07-15 08:39:26 UTC (rev 
1317)
+++ trunk/pysoy/src/scenes/Landscape.pym        2008-07-15 19:20:06 UTC (rev 
1318)
@@ -87,7 +87,8 @@
   cdef void _createArrays(self) :
     cdef int _i, _j, _currentLoop, _offset
     cdef unsigned short _a, _b, _c, _d
-    # set up the vert array
+    #
+    # Calculate positions and texcoords first
     for _i from 0 <= _i < self._heightmapTex._height :
       for _j from 0 <= _j < self._heightmapTex._width :
         _offset = self._heightmapTex._width*_i+_j
@@ -98,13 +99,18 @@
         self._vertArray[_offset].pz = <float> _i / self._heightmapTex._height \
                                       * self._depth + self._position[2]
         #all below need to be calculated CORRECTLY!
+        self._vertArray[_offset].tx = 0 # _j * texture scale
+        self._vertArray[_offset].ty = 0 # _i * texture scale
+        self._vertArray[_offset].tz = 0 # obtained from another texture map
+    #
+    # Normals and tangents calculated second because they depend on position
+    for _i from 0 <= _i < self._heightmapTex._height :
+      for _j from 0 <= _j < self._heightmapTex._width :
+        _offset = self._heightmapTex._width*_i+_j
         self._vertArray[_offset].nx = 0
         self._vertArray[_offset].ny = 1 # Up
         self._vertArray[_offset].nz = 0
-        self._vertArray[_offset].tx = 0
-        self._vertArray[_offset].ty = 1
-        self._vertArray[_offset].tz = 0
-        self._vertArray[_offset].ux = 1
+        self._vertArray[_offset].ux = 1 # Up
         self._vertArray[_offset].uy = 0
         self._vertArray[_offset].uz = 0
     #clear vars for next loops!

_______________________________________________
PySoy-SVN mailing list
PySoy-SVN@pysoy.org
http://www.pysoy.org/mailman/listinfo/pysoy-svn

Reply via email to