Author: ArcRiley
Date: 2007-07-07 05:58:16 -0400 (Sat, 07 Jul 2007)
New Revision: 399
Added:
trunk/pysoy/tests/vid_pyramid.py
Modified:
trunk/pysoy/src/textures/Texture.pxi
Log:
fixed trivial bug in _bind, added example script with video on a pyramid
Modified: trunk/pysoy/src/textures/Texture.pxi
===================================================================
--- trunk/pysoy/src/textures/Texture.pxi 2007-07-07 09:46:39 UTC (rev
398)
+++ trunk/pysoy/src/textures/Texture.pxi 2007-07-07 09:58:16 UTC (rev
399)
@@ -89,6 +89,8 @@
gl.glTexParameteri(self._textureTarget, gl.GL_TEXTURE_MIN_FILTER,
gl.GL_LINEAR)
self._update = 1
+ else :
+ gl.glBindTexture(self._textureTarget, self._textureID)
if self._update :
if self._textureTarget == gl.GL_TEXTURE_1D :
gl.glTexImage1D(gl.GL_TEXTURE_1D, 0, self._iFormats[self._chans],
@@ -106,8 +108,6 @@
self._oFormats[self._chans], gl.GL_UNSIGNED_BYTE,
self._texels)
self._update = 0
- else :
- gl.glBindTexture(self._textureTarget, self._textureID)
if self._scaleX :
gl.glMatrixMode(gl.GL_TEXTURE)
gl.glScalef(self._scaleX, self._scaleY, self._scaleZ)
Added: trunk/pysoy/tests/vid_pyramid.py
===================================================================
--- trunk/pysoy/tests/vid_pyramid.py (rev 0)
+++ trunk/pysoy/tests/vid_pyramid.py 2007-07-07 09:58:16 UTC (rev 399)
@@ -0,0 +1,27 @@
+#!/usr/bin/env python
+
+import Image
+import soy
+from time import sleep
+
+img = Image.open('lava.png')
+lava = soy.textures.Image(img)
+
+ogg = soy.transports.File('changeworld.ogg')
+vido = ogg['video']
+
+scr = soy.Screen()
+win = soy.Window(scr, 'Textured Pyramid')
+
+sce = soy.Scene()
+cam = soy.bodies.Camera(sce)
+cam.position = (0.0, 0.0, 5.0)
+
+ca1 = soy.widgets.Canvas(win, margin=10, aspect=0.0, texture=lava)
+pro = soy.widgets.Projector(win, camera=cam)
+pyr = soy.bodies.Pyramid(sce, vido)
+pyr.rotation = (1.0, 1.0, 0.0)
+
+if __name__ == '__main__' :
+ while True:
+ sleep(10)
Property changes on: trunk/pysoy/tests/vid_pyramid.py
___________________________________________________________________
Name: svn:executable
+ *
_______________________________________________
PySoy-SVN mailing list
[email protected]
http://www.pysoy.org/mailman/listinfo/pysoy-svn