Author: ArcRiley
Date: 2008-01-12 09:58:24 +0000 (Sat, 12 Jan 2008)
New Revision: 768

Modified:
   trunk/pysoy/examples/blocks.py
   trunk/pysoy/examples/collide_blocks.py
   trunk/pysoy/examples/joint_blocks.py
Log:
Changing old 8 colors to new materials by ShriphaniPalakodety


Modified: trunk/pysoy/examples/blocks.py
===================================================================
--- trunk/pysoy/examples/blocks.py      2008-01-12 09:34:41 UTC (rev 767)
+++ trunk/pysoy/examples/blocks.py      2008-01-12 09:58:24 UTC (rev 768)
@@ -2,12 +2,7 @@
 from random import random
 
 class BlockMesh(soy.meshes.Mesh) :
-  def __init__(self, diffuse, specular) :
-    mycol = soy.materials.Material()
-    mycol.ambient = diffuse
-    mycol.diffuse = diffuse
-    mycol.specular = specular
-    mycol.shininess = 5.0
+  def __init__(self, mycol) :
     black = soy.materials.Material()
     black.ambient.hex = '#000'
     black.diffuse.hex = '#444'
@@ -78,23 +73,21 @@
 
 def blocks(sce):
   colors = {
-    'aqua' : ((0.2, 0.9, 0.9), (0.4, 1.0, 1.0), ( 0, 0, 0)),
-    'teal' : ((0.2, 0.4, 1.0), (0.4, 0.6, 1.0), ( 4,-1,-4)),
-    'rose' : ((1.0, 0.2, 0.4), (1.0, 0.4, 0.6), (-3,-2,-2)),
-    'jade' : ((0.2, 1.0, 0.3), (1.0, 0.4, 0.6), ( 0,-2,-1)),
-    'gold' : ((1.0, 0.8, 0.1), (1.0, 0.9, 0.2), ( 5, 3,-6)),
-    'grey' : ((0.7, 0.7, 0.7), (1.0, 1.0, 1.0), (-1, 2,-3)),
-    'plum' : ((0.9, 0.2, 0.9), (1.0, 0.4, 1.0), (-4, 1,-5)),
-    'pink' : ((0.9, 0.6, 0.6), (1.0, 0.8, 0.8), ( 3, 0,-8)),
+    'Aventurine'     : (soy.materials.Aventurine(),    ( 0, 0, 0)),
+    'Basalt'         : (soy.materials.Basalt(),        ( 4,-1,-4)),
+    'Copper'         : (soy.materials.Copper(),        (-3,-2,-2)),
+    'CopperSulfate'  : (soy.materials.CopperSulfate(), ( 0,-2,-1)),
+    'DarkWood'       : (soy.materials.DarkWood(),      ( 5, 3,-6)),
+    'Pearl'          : (soy.materials.Pearl(),         (-1, 2,-3)),
+    'Rhodonite'      : (soy.materials.Rhodonite(),     (-4, 1,-5)),
+    'VelvetyRed'     : (soy.materials.VelvetyRed(),    ( 3, 0,-8)),
   }
   bmesh = {}
   blocks = {}
   for color in colors :
-    diffuse = soy.colors.Color(floats=colors[color][0])
-    specular = soy.colors.Color(floats=colors[color][1])
-    bmesh[color] = BlockMesh(diffuse, specular)
+    bmesh[color] = BlockMesh(colors[color][0])
     blocks[color] = soy.bodies.Body(sce, mesh=bmesh[color], 
-                                    position=colors[color][2])
+                                    position=colors[color][1])
     blocks[color].rotation = (srand(), srand(), srand())
     blocks[color].shape = soy.shapes.Box(1,1,1)
     t = -0.5

Modified: trunk/pysoy/examples/collide_blocks.py
===================================================================
--- trunk/pysoy/examples/collide_blocks.py      2008-01-12 09:34:41 UTC (rev 
767)
+++ trunk/pysoy/examples/collide_blocks.py      2008-01-12 09:58:24 UTC (rev 
768)
@@ -20,12 +20,12 @@
 pro = soy.widgets.Projector(win, camera=cam)
 can = soy.widgets.Canvas(win, texture=fps)
 key = soy.controllers.Keyboard(win)
-key['Q'] = soy.actions.Force(bks['teal'], -100,    0,    0)
-key['R'] = soy.actions.Force(bks['teal'],    0,  100,    0)
-key['S'] = soy.actions.Force(bks['teal'],  100,    0,    0)
-key['T'] = soy.actions.Force(bks['teal'],    0, -100,    0)
-key['U'] = soy.actions.Force(bks['teal'],    0,    0, -100)
-key['V'] = soy.actions.Force(bks['teal'],    0,    0,  100)
+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
 def foo():

Modified: trunk/pysoy/examples/joint_blocks.py
===================================================================
--- trunk/pysoy/examples/joint_blocks.py        2008-01-12 09:34:41 UTC (rev 
767)
+++ trunk/pysoy/examples/joint_blocks.py        2008-01-12 09:58:24 UTC (rev 
768)
@@ -11,18 +11,18 @@
 lig.position = (-10.0,10.0,2.0)
 bks = blocks.blocks(sce)
 
-jnt = soy.joints.Fixed(sce, bks['teal'], bks['rose'])
+jnt = soy.joints.Fixed(sce, bks['Pearl'], bks['VelvetyRed'])
 
 scr = soy.Screen()
 win = soy.Window(scr, 'Collision Blocks', background=soy.colors.Teal())
 pro = soy.widgets.Projector(win, camera=cam)
 key = soy.controllers.Keyboard(win)
-key['Q'] = soy.actions.Force(bks['teal'], -100,    0,    0)
-key['R'] = soy.actions.Force(bks['teal'],    0,  100,    0)
-key['S'] = soy.actions.Force(bks['teal'],  100,    0,    0)
-key['T'] = soy.actions.Force(bks['teal'],    0, -100,    0)
-key['U'] = soy.actions.Force(bks['teal'],    0,    0, -100)
-key['V'] = soy.actions.Force(bks['teal'],    0,    0,  100)
+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
 wcn = soy.controllers.Window(win)

_______________________________________________
PySoy-SVN mailing list
[email protected]
http://www.pysoy.org/mailman/listinfo/pysoy-svn

Reply via email to