[pygame]

2010-04-18 Thread rouiller olivier
unsubscribe pygame-users


Re: [pygame] exact algebraic numbers?

2009-11-29 Thread rouiller olivier
Hi Mike,

Such algebraic numbers are used in computational geometry, you can take a
look at CGAL http://www.cgal.org, it's a powerfull Computational geometry
written in C++ (a python binding exists) and it has an algebraic kernel for
exact computation of points on a circle or on a sphere.
I'm not sure that it includes the transformations because it is done to
maintain data structures like meshes, etc...
Well you have to see if it suits your need and if the effort of installing
it is woth it!

Regards.
Olivier

2009/11/29 René Dudfield 

> On Sun, Nov 29, 2009 at 5:59 AM, Michael George 
> wrote:
> >
> > Hello,
> >
> > For my game I need to represent right isosceles triangles, and do
> operations including translation and rotation in 15 degree increments.
>  Unfortunately, I cannot tolerate rounding error, because it will cause bad
> visual and gameplay artifacts.  I'm thinking of representing points as
> vectors where the components are of the form
> >
> > a + b * sqrt(2) + c * sqrt(3) + d * sqrt(6)
> >
> > where a, b, c, and d are rationals.  I believe numbers of this form are
> sufficient for my purposes, although I haven't worked out all the proofs
> yet.  Anyway, I was wondering if anyone has done anything similar and can
> suggest a library I can use for manipulating such vectors before I go off
> and implement it myself.
> >
> > Thanks!
> >
> > --Mike
>
>
> hi,
>
> python 2.6 and 3.1 have a fractions module:
> http://docs.python.org/library/fractions.html
>
> The Fraction class inherits from the abstract base class numbers.Rational:
>http://docs.python.org/library/numbers.html#numbers.Rational
>
> To avoid rounding (and other numerical) errors, the typical technique
> is to apply the transformations each time from the identity matrix.
> So in a game where a rotation happens at say 1.0 - 1.444 degrees each
> frame, you keep count of the total rotation (eg 1.444) and apply the
> total rotation every frame.  Rather than applying the 1.0 rotation one
> frame, and then applying the 1.444 rotation the next frame.   Over
> 10,000 frames or so, you can see there would be little rounding error.
>
> You can also use integers instead of floats, but divide the value by
> 1,000,000 or so.  eg, 1.444 degrees could be 1,444,000.  Then as you
> do not get the floating point problems.  If all of your angles are
> between 0-360, and the angle increments are also small it turns out
> ok.  Python has a long type, so you can get a lot of precision this
> way, and avoid floating point problems somewhat.  Just before you use
> the rotation, you can divide the number by 1,000,000 or so(1444000 /
> 100 == 1.444).
>
>
> cu.
>



-- 
Rouiller Olivier
06 79 66 89 63
Résidence Léonard de Vinci
App. A008
59650 Villeneuve d'Ascq


Re: [pygame] Spam problem with joystick module

2009-11-15 Thread rouiller olivier
Yeah I did that and it's perfect,

here is the link, Rene gave it to me, maybe it can help someone else :

http://thorbrian.com/pygame/builds.php

2009/11/15 Lenard Lindstrom 

> Hi rouiller,
>
> Somehow the joystick extension module is being compiled with the debug
> switch set (DEBUG macro defined). Try getting the most recent build from SVN
> at http://thorbrian.com/pygame/builds.php. I think this problem should be
> fixed.
>
> Lenard Lindstrom
>
> rouiller olivier wrote:
>
>> Thanks for the file, they work well but I still have the spam.
>> I guess I will have to deal with it til next release and hope the game
>> will still be playable.
>>
>>
>>
>> 2009/11/13 Thiago Chaves mailto:shundr...@gmail.com
>> >>
>>
>>
>>Rouiller, check if these work for you.
>>
>>Teste1.py controls a circle (and a line, if you have 2 or more
>>directional pads) on the window.
>>Teste2.py outputs button numbers and directional axes information
>>(it's a bit spammy when you're dealing with analog directional
>>buttons, it's just because there's so many different values the
>>axes can take in that case).
>>
>>-Thiago
>>
>>
>>On Fri, Nov 13, 2009 at 2:15 AM, rouiller olivier
>>mailto:o.rouil...@gmail.com>> wrote:
>>
>>    ok thank's let's try to build it, should be a good exercise
>>after all.
>>
>>2009/11/13 Lorenz Quack ><mailto:d...@amberfisharts.com>>
>>
>>
>>Hi,
>>
>>
>>rouiller olivier wrote:
>>
>>The calls to get_axis and get_button cause these
>>outputs...
>>Maybee there is another way of getting the values?..
>>
>>
>>    Not sure if there is another way.
>>Note that this is already fixed in svn trunk.
>>So I guess you can either try to build pygame from source
>>from the svn version or
>>wait for the next release.
>>
>>
>>regards
>>//Lorenz
>>
>>
>>
>>
>>--Rouiller Olivier
>>06 79 66 89 63
>>Résidence Léonard de Vinci
>>App. A008
>>59650 Villeneuve d'Ascq
>>
>>
>>
>>
>>
>> --
>> Rouiller Olivier
>> 06 79 66 89 63
>> Résidence Léonard de Vinci
>> App. A008
>> 59650 Villeneuve d'Ascq
>>
>
>


-- 
Rouiller Olivier
06 79 66 89 63
Résidence Léonard de Vinci
App. A008
59650 Villeneuve d'Ascq


Re: [pygame] Spam problem with joystick module

2009-11-13 Thread rouiller olivier
Thanks for the file, they work well but I still have the spam.
I guess I will have to deal with it til next release and hope the game will
still be playable.



2009/11/13 Thiago Chaves 

> Rouiller, check if these work for you.
>
> Teste1.py controls a circle (and a line, if you have 2 or more directional
> pads) on the window.
> Teste2.py outputs button numbers and directional axes information (it's a
> bit spammy when you're dealing with analog directional buttons, it's just
> because there's so many different values the axes can take in that case).
>
> -Thiago
>
>
> On Fri, Nov 13, 2009 at 2:15 AM, rouiller olivier wrote:
>
>> ok thank's let's try to build it, should be a good exercise after all.
>>
>> 2009/11/13 Lorenz Quack 
>>
>> Hi,
>>>
>>>
>>> rouiller olivier wrote:
>>>
>>>> The calls to get_axis and get_button cause these outputs...
>>>> Maybee there is another way of getting the values?..
>>>>
>>>
>>> Not sure if there is another way.
>>> Note that this is already fixed in svn trunk.
>>> So I guess you can either try to build pygame from source from the svn
>>> version or
>>> wait for the next release.
>>>
>>>
>>> regards
>>> //Lorenz
>>>
>>
>>
>>
>> --
>> Rouiller Olivier
>> 06 79 66 89 63
>> Résidence Léonard de Vinci
>> App. A008
>> 59650 Villeneuve d'Ascq
>>
>
>


-- 
Rouiller Olivier
06 79 66 89 63
Résidence Léonard de Vinci
App. A008
59650 Villeneuve d'Ascq


Re: [pygame] Spam problem with joystick module

2009-11-12 Thread rouiller olivier
ok thank's let's try to build it, should be a good exercise after all.

2009/11/13 Lorenz Quack 

> Hi,
>
>
> rouiller olivier wrote:
>
>> The calls to get_axis and get_button cause these outputs...
>> Maybee there is another way of getting the values?..
>>
>
> Not sure if there is another way.
> Note that this is already fixed in svn trunk.
> So I guess you can either try to build pygame from source from the svn
> version or
> wait for the next release.
>
>
> regards
> //Lorenz
>



-- 
Rouiller Olivier
06 79 66 89 63
Résidence Léonard de Vinci
App. A008
59650 Villeneuve d'Ascq


Re: [pygame] Spam problem with joystick module

2009-11-12 Thread rouiller olivier
The calls to get_axis and get_button cause these outputs...
Maybee there is another way of getting the values?..

2009/11/12 rouiller olivier 

> Here is the code I use to test the pad, I found it on the net.
>
> pygame.init()
> #joystick.init()
> j = pygame.joystick.Joystick(0)
> j.init()
> #print 'Initialized Joystick : %s' % j.get_name()
> try:
> while True:
> pygame.event.pump()
> for i in range(0, j.get_numaxes()):
> if j.get_axis(i) != 0.00:
> pass
> #print 'Axis %i reads %.2f' % (i, j.get_axis(i))
> for i in range(0, j.get_numbuttons()):
> if j.get_button(i) != 0:
> pass
> #print 'Button %i reads %i' % (i, j.get_button(i))
> except KeyboardInterrupt:
> j.quit()
>
> As you can see I commented the prints but I still have the same output :
> SDL_JoystickGetButton value:0:
> SDL_JoystickGetButton value:0:
> SDL_JoystickGetAxis value:-257:
> SDL_JoystickGetAxis value:-257:
> SDL_JoystickGetAxis value:-257:
> SDL_JoystickGetAxis value:-257:
> SDL_JoystickGetButton value:0:
>
> And so on...
> Were you able to use a joystick without output?
> If so do use a different of pygame or python?
>
> Thanks for the help!
>
>
>
> 2009/11/12 Alex Nordlund 
>
> Check your code, comment out every line that begins with 'print' ;-)
>>
>> ---
>> //Alex
>>
>>
>> On Thu, Nov 12, 2009 at 11:23 PM, Thiago Chaves 
>> wrote:
>> > You might want to be more specific.
>> >
>> > -Thiago
>> >
>> > On Thu, Nov 12, 2009 at 7:36 PM, rouiller olivier > >
>> > wrote:
>> >>
>> >> Hi everyone,
>> >>
>> >> I am trying to use a gamepad for a game project but whenever I check
>> for a
>> >> pad event I get some printing in the console.
>> >> I saw some discutions about the subject but no solution.
>> >>
>> >> I am on windows7 python26 pygame191 and I develop on Eclipse with
>> pydev.
>> >>
>> >> Does someone have encounter the same problem and found a solution?
>> >>
>> >> Thx for your help.
>> >>
>> >> Regards.
>> >> Olivier
>> >>
>> >> --
>> >> Rouiller Olivier
>> >> 06 79 66 89 63
>> >> Résidence Léonard de Vinci
>> >> App. A008
>> >> 59650 Villeneuve d'Ascq
>> >>
>> >>
>> >>
>> >> --
>> >> Rouiller Olivier
>> >> 06 79 66 89 63
>> >> Résidence Léonard de Vinci
>> >> App. A008
>> >> 59650 Villeneuve d'Ascq
>> >
>> >
>>
>
>
>
> --
> Rouiller Olivier
> 06 79 66 89 63
> Résidence Léonard de Vinci
> App. A008
> 59650 Villeneuve d'Ascq
>



-- 
Rouiller Olivier
06 79 66 89 63
Résidence Léonard de Vinci
App. A008
59650 Villeneuve d'Ascq


Re: [pygame] Spam problem with joystick module

2009-11-12 Thread rouiller olivier
Here is the code I use to test the pad, I found it on the net.

pygame.init()
#joystick.init()
j = pygame.joystick.Joystick(0)
j.init()
#print 'Initialized Joystick : %s' % j.get_name()
try:
while True:
pygame.event.pump()
for i in range(0, j.get_numaxes()):
if j.get_axis(i) != 0.00:
pass
#print 'Axis %i reads %.2f' % (i, j.get_axis(i))
for i in range(0, j.get_numbuttons()):
if j.get_button(i) != 0:
pass
#print 'Button %i reads %i' % (i, j.get_button(i))
except KeyboardInterrupt:
j.quit()

As you can see I commented the prints but I still have the same output :
SDL_JoystickGetButton value:0:
SDL_JoystickGetButton value:0:
SDL_JoystickGetAxis value:-257:
SDL_JoystickGetAxis value:-257:
SDL_JoystickGetAxis value:-257:
SDL_JoystickGetAxis value:-257:
SDL_JoystickGetButton value:0:

And so on...
Were you able to use a joystick without output?
If so do use a different of pygame or python?

Thanks for the help!



2009/11/12 Alex Nordlund 

> Check your code, comment out every line that begins with 'print' ;-)
>
> ---
> //Alex
>
>
> On Thu, Nov 12, 2009 at 11:23 PM, Thiago Chaves 
> wrote:
> > You might want to be more specific.
> >
> > -Thiago
> >
> > On Thu, Nov 12, 2009 at 7:36 PM, rouiller olivier 
> > wrote:
> >>
> >> Hi everyone,
> >>
> >> I am trying to use a gamepad for a game project but whenever I check for
> a
> >> pad event I get some printing in the console.
> >> I saw some discutions about the subject but no solution.
> >>
> >> I am on windows7 python26 pygame191 and I develop on Eclipse with pydev.
> >>
> >> Does someone have encounter the same problem and found a solution?
> >>
> >> Thx for your help.
> >>
> >> Regards.
> >> Olivier
> >>
> >> --
> >> Rouiller Olivier
> >> 06 79 66 89 63
> >> Résidence Léonard de Vinci
> >> App. A008
> >> 59650 Villeneuve d'Ascq
> >>
> >>
> >>
> >> --
> >> Rouiller Olivier
> >> 06 79 66 89 63
> >> Résidence Léonard de Vinci
> >> App. A008
> >> 59650 Villeneuve d'Ascq
> >
> >
>



-- 
Rouiller Olivier
06 79 66 89 63
Résidence Léonard de Vinci
App. A008
59650 Villeneuve d'Ascq


Re: [pygame] Need names and nationalities for AI playes in new sport-game

2009-11-12 Thread rouiller olivier
Olivier Rouiller - FRANCE

regards!

2009/11/12 Thadeus Burgess 

> Sweet! Thadeus Burgess - Texas USA - Caucasian
>
>
>
>
> On Thu, Nov 12, 2009 at 8:25 AM, leo kirotawa  wrote:
>
>>  Cool!!  Put my name too plz, I am from Brazil / BR / Brazilian, name is:
>> leonidas kirotawa.
>>
>> cheers
>>
>>
>> On Thu, Nov 12, 2009 at 9:47 AM, Ben Collier  wrote:
>>
>>> Excellent!
>>>
>>> My name, as I guess it says in the "from" field, is "Ben Collier", and
>>> I'm from England / Britain / UK.
>>>
>>> 2009/11/12 John Eriksson 
>>>
>>> Hi fellow pygame developers!
>>>>
>>>> I'm developing a sports game. It's a fictive sport played one-on-one,
>>>> on ice against another human player or against a rather advanced AI.
>>>>
>>>>  As part of the game it is possible to create a career in the World
>>>> Series against 40 (or so) AI controlled players.
>>>>
>>>> I started to search the net to find inspiration for names and
>>>> nationalities to the AI-players. But then I thought it would be much
>>>> nicer to use the names and nationalities of pygame developers instead
>>>> of just using fictive names.
>>>>
>>>> All AI-players will have different skill levels wich is randomly set
>>>> in the begining of a new World Series career. In one career your named
>>>> character will be the best in the world, and in another it might be a
>>>> rookie in Division 4.
>>>>
>>>> The game will be released as Freeware for both Linux and Windows. The
>>>> source code will (as allways for my projects) be available once the
>>>> game is done.
>>>>
>>>> If you wan't your name to apear as a AI-player in the game, please
>>>> send me your name (first + last) and your nationality.
>>>>
>>>> Best Regards
>>>> /John Eriksson
>>>> http://arainyday.se
>>>>
>>>
>>>
>>
>>
>> --
>> Leônidas S. Barbosa (Kirotawa)
>> [DesenvolvedorWeb/CEFET/RN]
>> [Ciências da Computação/UFRN]
>> [pós-graduando em Inteligência Computacional/Processamento Gráfico /UFRN
>> [Estudante de japonês nível 8 - Japanese Student]
>> [Desenvolvedor em python, PyGame]
>> blog: corecode.wordpress.com/
>>
>> "Mais sábio é aquele que sabe que não sabe" (Sócrates)
>>
>> 日本語の学生です。
>> コンピュータサイエンスの学位.
>>
>>
>


-- 
Rouiller Olivier
06 79 66 89 63
Résidence Léonard de Vinci
App. A008
59650 Villeneuve d'Ascq


[pygame] Spam problem with joystick module

2009-11-12 Thread rouiller olivier
Hi everyone,

I am trying to use a gamepad for a game project but whenever I check for a
pad event I get some printing in the console.
I saw some discutions about the subject but no solution.

I am on windows7 python26 pygame191 and I develop on Eclipse with pydev.

Does someone have encounter the same problem and found a solution?

Thx for your help.

Regards.
Olivier

-- 
Rouiller Olivier
06 79 66 89 63
Résidence Léonard de Vinci
App. A008
59650 Villeneuve d'Ascq



-- 
Rouiller Olivier
06 79 66 89 63
Résidence Léonard de Vinci
App. A008
59650 Villeneuve d'Ascq