School project.

vactruijen's icon

What are we doing?
We started off earlier this year with making a game. We use the MAX software, to recognize different collors, I will explain this later.
Our idea is, to use one webcam; a board, that is placed under the webcam, and two collored cards.
Right now we made a patch that recognizes the different collors. We can adjust the tone of the volume by moving it around in front of a camera.

We want to get different animations and/or sounds, if we move the collored card on the board. The camera will be attached to the board, into a lamp. The lamp is to lighten up the board. The board will have a grid on it, like a chess board. Standard boxes, in which our card fits. Based in which box the card is, an event will be triggered.

Right now we want to know the following thing:
Is it possible to define the x and y coordinates to one box on the board? Like this we can make a game that always changes. You do one simple move on the board, and the presentation will show an amimation and/or sound; this animation will be based on where you were on the board, and which animation happened already with your card.

If you have any tips for our team, please post them.

Luke Woodbury's icon

Not sure I follow exactly what you want, but if you want to study individual sections of the image then maybe look at jit.submatrix.

seejayjames's icon

also you can use two [jit.findbounds] objects to recognize the two different-colored cards. the coordinate outputs from these should be all you need. you'll have to do some pretty fine tweaking to make it match the grid, so be sure the camera is straight down, the same distance away each time, etc. To determine what animation/other trigger you want, based upon where the colors are, you can try [split] which will let you define areas based on its numbers. Numbers out of your [split] range can be sent to a series of additional [split] objects, or if you're really exact, you can try defining your rectangular areas using a multiplier.

"and which animation happened already with your card"

you'll need a way to track the prior animations. easiest if they are labeled with a unique number. try [zl group] and store with [zl reg] to keep your trigger list, then you bang out the list and analyze the elements as you want.

sounds like it could be a pretty cool game!