Monday, August 20, 2007

Check out Pyglet!

Pyglet is a cross-platform windowing and multimedia library for Python. If you've been using pygame all your life (like me), you need check it out.

Pyglet uses OpenGL. It makes blitting a 2D image as simple as
image.blit(x,y)
The API is exceptionally clean, IMO, and is accompanied by a programming guide and an API reference.

It also allows you to code for multi-head setups, and provides positional audio via OpenAL. Awesome! And best of all... there is no building required! It's 100% Pure Python.

Pyglet is still in alpha phase, so don't expect everything to work perfectly. Having said that... it works well enough for me. I'm converted.

Friday, August 17, 2007

ICCARUS Footage

The chaps over at viddler are hosting a video of our ICCARUS presentation. The video skips the first moments of the presentation, where I load a few instances of the Python interpreter... to jeers (maybe cheers :-) from (I guessing here) the Rails aficionados in the crowd.

Update: ICCARUS Screencast is now available on scouta.

Wednesday, August 15, 2007

ICCARUS wins at Webjam



The ICCARUS (Interactive Command Console and Relational User Statistics) tool was launched at webjam this evening, and won first place via popular vote.

Some nervous moment were had, due to the Ubuntu laptop not playing nicely with the projector setup... a few minutes of xorg.conf hacking... and we were up and running... phew!

ICCARUS provides a three dimensional visualisation of the data behind scouta.com. It shows the social network between members, the memberships of scouta groups, and the links between members and the videos/podcasts which they enjoy.

The 'galaxy' can be navigated by clicking on points of interest, or searched using commands.

The really neat thing, is that the galaxy is not static. It can be dynamically reconfigured via custom constraint expressions, to show how the different node types cluster around items, groups and users. This provides instant visual feedback on the health and growth of the system and how people are using the system.

The data is fetched via web services provided by TurboGears, and uses an (as yet) unreleased version of the GFX library to create the visuals.

Tuesday, August 14, 2007

ICCARUS is coming...

The Python-Powered ICCARUS will make its first public appearance on Wednesday, August 15, 2007 during webjam at the Velvet Lounge, Perth, West Australia.

Wednesday, August 01, 2007

Scouta JetBlack, launched!


The JetBlack release of scouta has just been launched. It comes with major interface changes, and iTunes integration via a mac-only client application.

GFX Demo Code

This little piece of code draws random sprites all over an 800x600 window using GFX. The GFX specific stuff has been commented, all the rest is standard Python/Pygame stuff.

  1 import random
2 import pygame
3 from gfx import gl, array, ext
4
5
6 def main():
7 pygame.init()
8 flags = pygame.OPENGL|pygame.DOUBLEBUF|pygame.HWSURFACE
9 pygame.display.set_mode((800,600), flags)
10
11 #setup the opengl window
12 gl.init((1280,800))
13
14 #create an image batch of 10000 images, which uses the texture 'sprite.png'
15 image_count = 10000
16 texture = ext.GLSurface(pygame.image.load('sprite.png'))
17 image_batch = ext.ImageBatch(image_count, texture)
18
19 #create 10000 random images, and use the whole texture for each image
20 for i in xrange(image_count):
21 x,y = random.randint(0,795), random.randint(0,595)
22 w,h = 5,5
23 vertices = (x,y),(x,y+h),(x+w,y+h),(x+w,y)
24 texture_coords = (0,0),(0,1),(1,1),(1,0)
25 image_batch.set_quad(i, vertices, texture_coords=texture_coords)
26
27 clock = pygame.time.Clock()
28 running = True
29 while running:
30 #clear the display
31 gl.clear((0.0,0.0,0.0,1.0))
32 #draw the image batch
33 image_batch.draw()
34 clock.tick()
35 pygame.display.flip()
36 if pygame.QUIT in (i.type for i in pygame.event.get()):
37 running = False
38 print 'FPS:', clock.get_fps()
39
40
41 if __name__ == "__main__":
42 main()
43

Popular Posts