[PD] Collision detection

Frank Barknecht fbar at footils.org
Wed Oct 15 11:44:17 CEST 2003

marius schebella hat gesagt: // marius schebella wrote:

> trigger: In Pd you have the problem that with for example the [+]-object
> only one inlet is hot (triggers the object). that means you can send any
> number of floats into the right inlet, but no result will be sent to the
> outlet. only if you send a message to the left inlet, the object is
> triggered. the same is with the logical operators. So you need to be sure
> that a message is is always sent to the right inlet before the left. And
> there you need the trigger object. It fires its outlets from right to left.
> [t b f] means "send the float and then send a bang".
> to create a subpatch just type "pd" followed by a name of your choice, like
> [pd collision]. then a new window pops up and with cut and paste you can
> place objects there, and also work there like in every patch window. it is
> like an extension to the parent window.

I'd like to add that collision detection is a good candidate for
making an abstraction instead of a subpatch, because you will need
this several times and thus the reusability of an abstraction comes in
handy. An abstraction is a pd-file in your path (or the current
directory). You need to find out which things in your algorithm will
change (like the coordinates of your objects: x1, y1, x2, y2) and then
make inlets in your abstraction for them: 

inlets:    x1    y1    x2   y2
		   -     -     -    -
outlet:    collision?

 Frank Barknecht                               _ ______footils.org__

More information about the Pd-list mailing list