[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] puzzle piece problem.
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] puzzle piece problem.
- From: "Dan Krol" <orblivion@xxxxxxxxx>
- Date: Wed, 7 Nov 2007 10:35:43 -0600
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Wed, 07 Nov 2007 11:35:53 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=sD7CyCRC7mDiHtYlywAy8F+AiWLhIF1/st5RXLekQqs=; b=HGgJ8dJD/WHNciSnpoDJ1TijBuZGr70u+BBSU7uLC1L9NdF2mp7QJSU4vsFlw7h0wMgM8gYSCSwkxiFN8d+AjIV93576MBCCUkOgxrv5k1JIdPdOsEn2hVaC3iy9v3NOCmQFqqwX9hM5ZNQ2YDneRBApxXtziRqvMMkoMsZjET4=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=WfpHVfS0qp2qOyRUoNKGq9eml/mLr3oL0oTQe2u0jREVHGTv8FcQFz6e3VTHYaznXGXa9vmZ+kHKYu8G8VJCcVGZEwU8texc/7T9JkIZv7ABvbqnQhrVbNexHtvfuK6Z12Qc4uJCvLRIbf8sYr1uu/nmsuDr03gz4gKNz0pXk0k=
- In-reply-to: <d07a228d0711070731oe901c4l3530605e572cbca@xxxxxxxxxxxxxx>
- References: <d07a228d0711070731oe901c4l3530605e572cbca@xxxxxxxxxxxxxx>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Hmm. I may not be the most versed in this, but my impression is that
it would be hard to represent a jigsaw piece with a continuous
function, such as a sinusoidal. I think you might want to do it
piecewise; straight lines and part of a circle.
On Nov 7, 2007 9:31 AM, Joseph king <king.a.joe@xxxxxxxxx> wrote:
> hey it is me again on the same issue..... thanks for the help but now
> i am on to something a little easier if you program a lot.
> My issue now if you saw the code that i had which i will repost on
> this...... creating a "cookie cutter" to cut out the puzzle piece
> shape of where the user wants and size/shape the user wants......
> but i seem to be having an issue with this line of code
>
>
> Def curvature_func(pos, eb_size, xmod, ymod):
> #A general curve to the piece kinda like a wavy line.
> state1 = float(pos) / float(xmod) * twopi
> state2 = float(pos) / float(ymod) * twopi
> state3 = float(pos) / float(xmod+ymod) * twopi
> state4 = float(pos) * (2.0/3.0) / float(xmod) * twopi
> state5 = float(pos) * (-12.0/5.0) / float(ymod) *twopi
>
> bgen = math.sin(state1) + math.cos (state2) + math.sin(state3)
> bgen = bgen - mat.cos(states4) + math.cos(state5)
>
> scale = (eb_size / 5.0
> bgen = (bgen * (scale*0.9))
> return int(bgen)
>
>
> seems that it only creates a very slight wave on the edge of the
> image. but no matter what i change it does not really give me a
> jigsaw like shape.
>
> does any one have any suggestions on a better way to make it more jigsaw like.
>