[pygame] using Color() with HSVA

2010-07-30 Thread Jake b
atm I have to use the cookbook to get RGB from HSV color. Docs say: *Color.hsva* *Gets or sets the HSVA representation of the Color.* Color.hsva: Return tuple This fails: pygame.ver '1.9.1release-svn2575' a2 = Color(1,2,4,5) type(a2) type 'pygame.Color' a2 (1, 2, 4, 5) a2.r, a2.a 1, 5

[pygame] 127.5

2010-07-30 Thread Ian Mallett
Hi, Intro: So, I'm working on computational fluid dynamics, and I need to initialize a velocity texture, which stores a vector field in an image. Velocity vectors can have a range of values; each component could be either positive and negative. The X component goes in the red channel, the Y in

Re: [pygame] 127.5

2010-07-30 Thread René Dudfield
Hi, use numpy? On Fri, Jul 30, 2010 at 3:10 PM, Ian Mallett geometr...@gmail.com wrote: Hi, Intro: So, I'm working on computational fluid dynamics, and I need to initialize a velocity texture, which stores a vector field in an image. Velocity vectors can have a range of values; each

Re: [pygame] 127.5

2010-07-30 Thread Luke Paireepinart
On Fri, Jul 30, 2010 at 9:10 AM, Ian Mallett geometr...@gmail.com wrote: The problem: Because of this, I need a surface filled with the color 127.5.  Obviously, more than 8 bits per channel are required.  To update the texture, I'm using GL_RGBA32F_ARB, which allocates 32 bits per channel. 

Re: [pygame] using Color() with HSVA

2010-07-30 Thread Luke Paireepinart
On Fri, Jul 30, 2010 at 2:43 AM, Jake b ninmonk...@gmail.com wrote: atm I have to use the cookbook to get RGB from HSV color. Docs say: Color.hsva Gets or sets the HSVA representation of the Color. Color.hsva: Return tuple This fails: a2.hsva (220.0, 75.0, 1.5686274509803921,

Re: [pygame] 127.5

2010-07-30 Thread B W
Use a data set for your computational values and convert them to display values as needed. I do this for sprites whenever I want micro speed adjustments, which in essence lets them move fractions of pixels per frame. Gumm

Re: [pygame] 127.5

2010-07-30 Thread Brian Fisher
I don't see why pygame should be involved at all in your texture creation. python's array module should let you create an array of floats, and glTexImage2d should support GL_FLOAT for the data type argument. Does that work? On Fri, Jul 30, 2010 at 7:10 AM, Ian Mallett geometr...@gmail.com

Re: [pygame] 127.5

2010-07-30 Thread Brian Fisher
Another ghetto solution is to not map to 0 to 255. map to 0 to 254, and then 127 is your 0 On Fri, Jul 30, 2010 at 7:10 AM, Ian Mallett geometr...@gmail.com wrote: Hi, Intro: So, I'm working on computational fluid dynamics, and I need to initialize a velocity texture, which stores a vector

[pygame] Sprite colours dont maintain same palette indicies

2010-07-30 Thread John Anderson
I'm having an issue with my attempts at implementing palette swapping, it seems that if I change the colours in the main palette (the display surface palette), all the sprites onscreen, rather than staying in their respective indicies on the palette, shift to the closest colour on the palette to

[pygame] Pygame Windows installer for Python 2.7

2010-07-30 Thread Lenard Lindstrom
http://www3.telus.net/len_l/pygame/md5sum:0c07ba255ec98e9e28aa117cc99b9b34 *pygame-1.9.2a0.win32-py2.7.msiLenard Lindstrom

Re: [pygame] Sprite colours dont maintain same palette indicies

2010-07-30 Thread Mel Collins
On 30 July 2010 19:10, John Anderson corporalmust...@gmail.com wrote: it seems that if I change the colours in the main palette (the display surface palette), all the sprites onscreen, rather than staying in their respective indicies on the palette, shift to the closest colour on the palette

Re: [pygame] Sprite colours dont maintain same palette indicies

2010-07-30 Thread John Anderson
ah, thats kind of akward syntax, but I think I can manage if I wrap it properly, thanks! On Fri, Jul 30, 2010 at 2:04 PM, Mel Collins m...@raumkraut.net wrote: On 30 July 2010 19:10, John Anderson corporalmust...@gmail.com wrote: it seems that if I change the colours in the main palette (the

Re: [pygame] Sprite colours dont maintain same palette indicies

2010-07-30 Thread John Anderson
Hmm, using .setPalette() doesnt seem to help matters, perhaps it has something to do with the way I've loaded images/ converted them? I've been using the image loader from the chimp tut, maybe theres a flag I need to set that I havent? The images are loaded from palettized .gifs and then converted

Re: [pygame] Sprite colours dont maintain same palette indicies

2010-07-30 Thread John Anderson
Ok, got it now, it seems that I have to modify the display's palette, not the display surface to achieve the desired effect. It's odd though, because I was fooling around with swapping the palettes on individual sprites and it seemed to work fine, its only the display surface that has this