Author: ArcRiley
Date: 2008-03-11 16:28:26 -0400 (Tue, 11 Mar 2008)
New Revision: 1133

Added:
   trunk/pysoy/examples/CollideBlocks.py
Removed:
   trunk/pysoy/examples/collide_blocks.py
Log:
Renaming for the wiki


Copied: trunk/pysoy/examples/CollideBlocks.py (from rev 1132, 
trunk/pysoy/examples/collide_blocks.py)
===================================================================
--- trunk/pysoy/examples/CollideBlocks.py                               (rev 0)
+++ trunk/pysoy/examples/CollideBlocks.py       2008-03-11 20:28:26 UTC (rev 
1133)
@@ -0,0 +1,76 @@
+#!/usr/bin/env python
+import soy
+import blocks
+from time import sleep
+
+sce = soy.scenes.Scene()
+cam = soy.bodies.Camera(sce)
+#cam.shape=soy.shapes.Sphere(2)
+cam.position = (0.0, 0.0, 15.0)
+lig = soy.bodies.Light(sce)
+lig.position = (-10.0,10.0,2.0)
+#m = soy.bodies.fields.Monopole(sce)
+#m.shape=soy.shapes.Sphere(15)
+#m.multiplier=.01
+bks = blocks.blocks(sce)
+fps = soy.textures.Print()
+
+scr = soy.Screen()
+win = soy.Window(scr, 'Collision Blocks', background=soy.colors.gray)
+pro = soy.widgets.Projector(win, camera=cam)
+can = soy.widgets.Canvas(win, texture=fps)
+
+def wireframeToggle() :
+  if cam.wireframe :
+    cam.wireframe = False
+  else :
+    cam.wireframe = True
+
+def fullscreenToggle() :
+  if scr.fullscreen :
+    scr.fullscreen = None
+  else :
+    scr.fullscreen = win
+
+def moreLight() :
+  lig.diffuse = lig.diffuse + 1.0
+  print lig.diffuse  
+
+def lessLight() :
+  lig.diffuse = lig.diffuse - 1.0
+  print lig.diffuse  
+
+key = soy.controllers.Keyboard(win)
+key['Q'] = soy.actions.Force(bks['Pearl'], -100,    0,    0)
+key['R'] = soy.actions.Force(bks['Pearl'],    0,  100,    0)
+key['S'] = soy.actions.Force(bks['Pearl'],  100,    0,    0)
+key['T'] = soy.actions.Force(bks['Pearl'],    0, -100,    0)
+key['U'] = soy.actions.Force(bks['Pearl'],    0,    0, -100)
+key['V'] = soy.actions.Force(bks['Pearl'],    0,    0,  100)
+key['q'] = soy.actions.Quit()
+key[ 1 ] = soy.actions.Quit() # 9 = esc key
+key['f'] = fullscreenToggle
+key['w'] = wireframeToggle
+key['['] = lessLight
+key[']'] = moreLight
+wcn = soy.controllers.Window(win)
+wcn['close'] = soy.actions.Quit()
+
+if __name__ == '__main__' :
+  while True:
+    sleep(.1)
+    if cam.fps: # TypeError: 
+                #   int() argument must be a string or a number, not 'NoneType'
+      fps.text = '%sfps' % str(int(cam.fps)).zfill(4)
+    for bk in bks :
+      p = bks[bk].position
+      v = bks[bk].velocity
+      v = [v[0], v[1], v[2]]
+      if abs(p[0]) > 5 and ((p[0]>0 and v[0]>0) or (p[0]<0 and v[0]< 0)) : 
+        v[0] = v[0]*-1
+      if abs(p[1]) > 5 and ((p[1]>0 and v[1]>0) or (p[1]<0 and v[1]< 0)) : 
+        v[1] = v[1]*-1
+      if abs(p[2]) > 5 and ((p[2]>0 and v[2]>0) or (p[2]<0 and v[2]< 0)) : 
+        v[2] = v[2]*-1
+      bks[bk].velocity = v
+

Deleted: trunk/pysoy/examples/collide_blocks.py
===================================================================
--- trunk/pysoy/examples/collide_blocks.py      2008-03-11 07:18:15 UTC (rev 
1132)
+++ trunk/pysoy/examples/collide_blocks.py      2008-03-11 20:28:26 UTC (rev 
1133)
@@ -1,76 +0,0 @@
-#!/usr/bin/env python
-import soy
-import blocks
-from time import sleep
-
-sce = soy.scenes.Scene()
-cam = soy.bodies.Camera(sce)
-#cam.shape=soy.shapes.Sphere(2)
-cam.position = (0.0, 0.0, 15.0)
-lig = soy.bodies.Light(sce)
-lig.position = (-10.0,10.0,2.0)
-#m = soy.bodies.fields.Monopole(sce)
-#m.shape=soy.shapes.Sphere(15)
-#m.multiplier=.01
-bks = blocks.blocks(sce)
-fps = soy.textures.Print()
-
-scr = soy.Screen()
-win = soy.Window(scr, 'Collision Blocks', background=soy.colors.gray)
-pro = soy.widgets.Projector(win, camera=cam)
-can = soy.widgets.Canvas(win, texture=fps)
-
-def wireframeToggle() :
-  if cam.wireframe :
-    cam.wireframe = False
-  else :
-    cam.wireframe = True
-
-def fullscreenToggle() :
-  if scr.fullscreen :
-    scr.fullscreen = None
-  else :
-    scr.fullscreen = win
-
-def moreLight() :
-  lig.diffuse = lig.diffuse + 1.0
-  print lig.diffuse  
-
-def lessLight() :
-  lig.diffuse = lig.diffuse - 1.0
-  print lig.diffuse  
-
-key = soy.controllers.Keyboard(win)
-key['Q'] = soy.actions.Force(bks['Pearl'], -100,    0,    0)
-key['R'] = soy.actions.Force(bks['Pearl'],    0,  100,    0)
-key['S'] = soy.actions.Force(bks['Pearl'],  100,    0,    0)
-key['T'] = soy.actions.Force(bks['Pearl'],    0, -100,    0)
-key['U'] = soy.actions.Force(bks['Pearl'],    0,    0, -100)
-key['V'] = soy.actions.Force(bks['Pearl'],    0,    0,  100)
-key['q'] = soy.actions.Quit()
-key[ 1 ] = soy.actions.Quit() # 9 = esc key
-key['f'] = fullscreenToggle
-key['w'] = wireframeToggle
-key['['] = lessLight
-key[']'] = moreLight
-wcn = soy.controllers.Window(win)
-wcn['close'] = soy.actions.Quit()
-
-if __name__ == '__main__' :
-  while True:
-    sleep(.1)
-    if cam.fps: # TypeError: 
-                #   int() argument must be a string or a number, not 'NoneType'
-      fps.text = '%sfps' % str(int(cam.fps)).zfill(4)
-    for bk in bks :
-      p = bks[bk].position
-      v = bks[bk].velocity
-      v = [v[0], v[1], v[2]]
-      if abs(p[0]) > 5 and ((p[0]>0 and v[0]>0) or (p[0]<0 and v[0]< 0)) : 
-        v[0] = v[0]*-1
-      if abs(p[1]) > 5 and ((p[1]>0 and v[1]>0) or (p[1]<0 and v[1]< 0)) : 
-        v[1] = v[1]*-1
-      if abs(p[2]) > 5 and ((p[2]>0 and v[2]>0) or (p[2]<0 and v[2]< 0)) : 
-        v[2] = v[2]*-1
-      bks[bk].velocity = v
-

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

Reply via email to