[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

*To*: pygame-users@seul.org*Subject*: Re: [pygame] Passing pionts through a matrix.*From*: Rene Dudfield <illumen@yahoo.com>*Date*: Sun, 09 Nov 2003 20:26:29 +1000*Delivered-to*: archiver@seul.org*Delivered-to*: pygame-users-outgoing@seul.org*Delivered-to*: pygame-users@seul.org*Delivery-date*: Sun, 09 Nov 2003 05:29:25 -0500*In-reply-to*: <20031109070231.9393.qmail@linuxmail.org>*References*: <20031109070231.9393.qmail@linuxmail.org>*Reply-to*: pygame-users@seul.org*Sender*: owner-pygame-users@seul.org*User-agent*: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031024 Debian/1.5-2

campbell barton wrote:

Hi, I am thinking about making a program where you can pass a list of points (x,y) through a rotation/scale/distortion matrix.In numeric is another module called Matrix.

This could be done through python but I was wondering if numeric would be better?

It would be a polyline - Not a image.

- Cam

import Matrix

They are pretty much the same as opengl matrices. Below is how to make a translation matrix. Just make your points z be 0.

def create_translation_matrix(position):

""" returns a translation matrix from the position given(x,y,z).

"""

x,y,z = position

return Matrix.Matrix( [[ 1., 0., 0., 0.,],

[ 0., 1., 0., 0.,],

[ 0., 0., 1., 0.,],

[ x, y, z, 1.,] ] )

Have fun!

http://www.holepit.com/

**References**:**[pygame] Passing pionts through a matrix.***From:*"campbell barton" <ideasman@linuxmail.org>

- Prev by Author:
**Re: [pygame] GL_MULTISAMPLEBUFFERS ????** - Next by Author:
**Re: [pygame] Movie module** - Previous by thread:
**Re: [pygame] Passing pionts through a matrix.** - Next by thread:
**[pygame] more maths wanted...** - Index(es):