|
Revision 1387, 0.9 kB
(checked in by ArcRiley, 4 weeks ago)
|
|
Quick fix: updated for new material API
|
-
Property svn:executable set to
*
|
| Line | |
|---|
| 1 | #!/usr/bin/env python |
|---|
| 2 | |
|---|
| 3 | import soy |
|---|
| 4 | from time import sleep |
|---|
| 5 | |
|---|
| 6 | sce = soy.scenes.Scene() |
|---|
| 7 | cam = soy.bodies.Camera(sce) |
|---|
| 8 | cam.position = (0.0, 0.0, 10.0) |
|---|
| 9 | lig = soy.bodies.Light(sce) |
|---|
| 10 | lig.position = (-10.0,10.0,2.0) |
|---|
| 11 | fps = soy.textures.Print() |
|---|
| 12 | ogg = soy.transports.File('media/changeworld.ogg') |
|---|
| 13 | vid = ogg['video'] |
|---|
| 14 | mat = soy.materials.Textured() |
|---|
| 15 | mat.colormap = vid |
|---|
| 16 | bil = soy.models.Billboard(mat) |
|---|
| 17 | bil.size = (4.0,3.0) |
|---|
| 18 | bod = soy.bodies.Body(sce) |
|---|
| 19 | bod.model = bil |
|---|
| 20 | bod.rotation = (1.0,0.4,0.2) |
|---|
| 21 | |
|---|
| 22 | scr = soy.Screen() |
|---|
| 23 | win = soy.Window(scr, 'Video Billboard') |
|---|
| 24 | pro = soy.widgets.Projector(win, camera=cam) |
|---|
| 25 | can = soy.widgets.Canvas(win, texture=fps) |
|---|
| 26 | |
|---|
| 27 | key = soy.controllers.Keyboard(win) |
|---|
| 28 | key['q'] = soy.actions.Quit() |
|---|
| 29 | key[ 1 ] = soy.actions.Quit() # 9 = esc key |
|---|
| 30 | wcn = soy.controllers.Window(win) |
|---|
| 31 | wcn['close'] = soy.actions.Quit() |
|---|
| 32 | |
|---|
| 33 | if __name__ == '__main__' : |
|---|
| 34 | while True: |
|---|
| 35 | sleep(0.3) |
|---|
| 36 | fps.text = str(cam.fps) |
|---|