Author: DavidCzech
Date: 2008-08-26 22:12:59 -0400 (Tue, 26 Aug 2008)
New Revision: 1348

Modified:
   trunk/pysoy/src/bodies/Camera.pym
   trunk/pysoy/src/scenes/Landscape.pym
Log:
Ticket 929: 
* Fixed a printf.
* Make wireframe not anti-aliased by default. 


Modified: trunk/pysoy/src/bodies/Camera.pym
===================================================================
--- trunk/pysoy/src/bodies/Camera.pym   2008-08-24 23:28:22 UTC (rev 1347)
+++ trunk/pysoy/src/bodies/Camera.pym   2008-08-27 02:12:59 UTC (rev 1348)
@@ -122,19 +122,19 @@
     #
     # Check if wireframe mode is turned on
     if self._wire == 1 :
-      gl.glEnable (gl.GL_LINE_SMOOTH)
-      gl.glEnable (gl.GL_BLEND)
+      #gl.glEnable (gl.GL_LINE_SMOOTH)
+      #gl.glEnable (gl.GL_BLEND)
       #gl.glBlendFunc (gl.GL_SRC_ALPHA, gl.GL_ONE_MINUS_SRC_ALPHA)    ## 
Anti-Aliasing maybe?
       #gl.glHint (gl.GL_LINE_SMOOTH_HINT, gl.GL_DONT_CARE)
-      gl.glLineWidth (3)
+      #gl.glLineWidth (3)
       gl.glPolygonMode(gl.GL_FRONT_AND_BACK, gl.GL_LINE)
     else :
       gl.glPolygonMode(gl.GL_FRONT_AND_BACK, gl.GL_FILL)
-      gl.glDisable (gl.GL_LINE_SMOOTH)
-      gl.glDisable (gl.GL_BLEND)
+      #gl.glDisable (gl.GL_LINE_SMOOTH)
+      #gl.glDisable (gl.GL_BLEND)
       #gl.glBlendFunc (gl.GL_SRC_ALPHA, gl.GL_ONE_MINUS_SRC_ALPHA)
       #gl.glHint (gl.GL_LINE_SMOOTH_HINT, gl.GL_DONT_CARE)
-      gl.glLineWidth (1)
+      #gl.glLineWidth (1)
     #
     # Now we apply an inverse matrix to translate to the Scene's origin
     gl.glMatrixMode(gl.GL_MODELVIEW)

Modified: trunk/pysoy/src/scenes/Landscape.pym
===================================================================
--- trunk/pysoy/src/scenes/Landscape.pym        2008-08-24 23:28:22 UTC (rev 
1347)
+++ trunk/pysoy/src/scenes/Landscape.pym        2008-08-27 02:12:59 UTC (rev 
1348)
@@ -51,6 +51,7 @@
     self._vertBuffer = 0
     self._faceBuffer = 0
     self._createArrays()
+    stdio.printf("EO-cinit\n");
     
   def __dealloc__(self) :
     ode.dGeomHeightfieldDataDestroy(self._heightfieldDataID)
@@ -321,7 +322,7 @@
       if _deltaRows[_i] < _minDelta :
         _minDelta = _deltaRows[_i]
     
-    stdio.printf("_maxDelta: %f, _minDelta: %f", _maxDelta, _minDelta)
+    stdio.printf("_maxDelta: %f, _minDelta: %f\n", _maxDelta, _minDelta)
     #
     # Free previously alloc'ed delta arrays
     py.PyMem_Free(_deltaCols)
@@ -349,6 +350,11 @@
                           gl.GLdouble _znear, gl.GLdouble _zfar) :
     #
     # Setup projection matrix
+    cdef gl.GLfloat _fogColor[4]
+    _fogColor[0] = .5
+    _fogColor[1] = .5
+    _fogColor[2] = .5
+    _fogColor[3] = 1.0
     cdef int _i, _pass
     _pass = 0
     gl.glMatrixMode(gl.GL_PROJECTION)
@@ -402,6 +408,17 @@
          (<soy.bodies.Body> self._bodies._list[_i])._model)._render(
          (<soy.bodies.Body> self._bodies._list[_i]))
     self._bodies._iterDone()
+    if self._fogDensity > 0 : # This should be at the top really
+      #
+      # Turn on some fog!
+      gl.glClearColor(0.5,0.5,0.5,1.0)  # We'll Clear To The Color Of The Fog 
( Modified )
+      gl.glEnable(gl.GL_FOG)                    #Enables GL_FOG
+      gl.glFogi(gl.GL_FOG_MODE, gl.GL_EXP2)     #Fog Mode
+      gl.glFogfv(gl.GL_FOG_COLOR, _fogColor)    #Set Fog Color
+      gl.glFogf(gl.GL_FOG_DENSITY, self._fogDensity/10)        #How Dense Will 
The Fog Be
+      gl.glHint(gl.GL_FOG_HINT, gl.GL_NICEST)   #Fog Hint Value
+      gl.glFogf(gl.GL_FOG_START, 1.0)           #Fog Start Depth
+      gl.glFogf(gl.GL_FOG_END, 50.0)             #Fog End Depth    
     #
     # Remember - turn off the lights before you leave
     for _i from 0 <= _i < self._lights._current :

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

Reply via email to