dot collisions?

> Dear Dr. Pelli,
>
> I'm using your great psychophysical toolbox on a mac. I show red
>and green random-dot-patterns moving in opposite directions. I would
>like that when a red dot is on top of a green dot, the dot becomes
>yellow thereby excluding perceptual occlusions. I tried several
>possibilities towards that end by changing the copyMode parameter in
>my command line:
> SCREEN('CopyWindow', movie(frame), window, destRect,
>putRect, copyMode)
> I did not succeed. Do you know a way to implement this, that is
>not by checking for every dot at every movie frame when a dot is
>'occluding' (same x-y pixel position) another?
> Thanks a lot! Looking forward to your reply,
>
> Karel Hol
>========================================================
>
>Dr. Karel Hol
>Helmholtz Institute
>Utrecht University
>Princetonplein 5
>NL-3584 CC Utrecht
>The Netherlands
>Phone +31 30 2532829
>Fax +31 30 2522664
>E-mail K.F.Hol@...
>URL http://www.phys.uu.nl/~wwwpm/PercMot/hol.html
>
>========================================================

dear karel

1. i would probably do this by checking for collisions.

2. in your particular paradigm, one simple trick would be to confine the
red dots to odd-numbered lines and green dots to even-numbered lines.
then they'd never collide.

3. it would be possible to achieve the desired effect by using an
additive copy mode. there are four different states you want to show:
white, red, green, and yellow. you want white to combine with red or
green and produce that same color, and red and green to combine to
produce yellow. i think you'd need to use 2, 4 or 8 bit pixels, and use
addition. Set up your CLUT so that you use 0 for white, 1 for red, 2 for
green, and 3 for yellow. however, i'm not at all sure that the additive
mode will in fact be faster than checking for collision.

best

denis