Author: DavidCzech
Date: 2008-03-22 03:34:45 -0400 (Sat, 22 Mar 2008)
New Revision: 1199

Modified:
   trunk/pysoy/src/scenes/Planar.pxi
Log:
Offset plane rendering

Modified: trunk/pysoy/src/scenes/Planar.pxi
===================================================================
--- trunk/pysoy/src/scenes/Planar.pxi   2008-03-22 06:03:25 UTC (rev 1198)
+++ trunk/pysoy/src/scenes/Planar.pxi   2008-03-22 07:34:45 UTC (rev 1199)
@@ -40,7 +40,7 @@
     This is a scene based on a collision plane of infinite size facing up in 
     the direction of gravity.
   '''
-  def __cinit__(self,offset=0, material=None, *args, **kw) :
+  def __cinit__(self,offset=0,step=15, material=None, *args, **kw) :
     self._offset = offset
     self._planeID = ode.dCreatePlane(self._spaceID, 0.0, 1.0, 0.0, 
self._offset)
     ode.dGeomSetCategoryBits(self._planeID,GeomScene)
@@ -48,13 +48,13 @@
     cdef Vert _a, _b, _c, _d, _e, _f
     SIZE = 100
     self._verts[0].px =  0.0 ## A Big Triangle 
-    self._verts[0].py =  0.0
+    self._verts[0].py =  self._offset
     self._verts[0].pz = SIZE + (ode.dSin(60)*SIZE)/2
     self._verts[1].px =  ode.dCos(60)*SIZE
-    self._verts[1].py =  0.0
+    self._verts[1].py =  self._offset
     self._verts[1].pz =  ode.dSin(60)*SIZE + (ode.dSin(60)*SIZE)/2
     self._verts[2].px = -ode.dCos(60)*SIZE
-    self._verts[2].py =  0.0
+    self._verts[2].py =  self._offset
     self._verts[2].pz =  ode.dSin(60)*SIZE + (ode.dSin(60)*SIZE)/2
     self._faces[0].a  =  0
     self._faces[0].b  =  2
@@ -71,10 +71,13 @@
     self._verts[2].ty = _c.pz - ode.dFabs(_c.pz)
     
     cdef int _i
-    for _i from 1 <= _i < 15 :
+    for _i from 1 <= _i < step :
       _d = midpoint(_a,_b) # We get the midpoints from the Big Triangle and 
create faces from them
       _e = midpoint(_b,_c)
       _f = midpoint(_c,_a)
+      _d.py =self._offset
+      _e.py =self._offset
+      _f.py =self._offset
       _d.tx = _d.px - ode.dFabs(_d.px)
       _d.ty = _d.pz - ode.dFabs(_d.pz)
       _e.tx = _e.px - ode.dFabs(_e.px)

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

Reply via email to