The task was challenging and we had to streamline the balloon passing simulation to be more abstract and simpler, due to our time and technical skill limitations. We were able to implement two algorithms simulating the hard and soft force (qualities of motion) our participants would apply to the balloon when playing (screen shots are shown below): (1) Hard and soft interactions (2) Hitting the Balloon to hard
(1) Hard and soft interactions - the balloon moves at the speed of the force that the participant hits it.
Figure 1. Detect Speed of x and y position of colour movement modified from detect_Speed.maxpat from Greg Corness. |
F = ma
(2) Hitting the Balloon to hard - If the participant hits the balloon to hard, the balloon would pop. There were two factors that caused the balloon to pop. If collision has occurred (participant has hit the balloon) and if the speed of collision is too hard. We simulated the balloon popping by making the image of the balloon disappear for 2 seconds before returning back on screen.
Figure 2. Detect Collision when colour overlaps the balloon image modified from [bounce].maxpat from Greg Corness. |
Figure 3. Detect Speed of collision modified from detect_Speed.maxpat from Greg Corness. |
Figure 4. Displaying the balloon off screen modified from [movingDigitalobject1].maxpat from Greg Corness. |
The third step involves checking if the participant has hit the balloon too hard. This was simulated by creating an if statement and hard coding a value indicating a hard (very fast) speed that would result in the balloon popping and going off screen. The if statement checks if the collision speed is greater than the hard coded fast speed, then sends a signal to a switch object to stop displaying the balloon image. However, we wanted the balloon to appear again so our participant can interact with the balloon again. We used a delay statement that changes the switch gate and makes the balloon appear again after 2 seconds.
Pseudocode:
Pseudocode:
- If color track overlaps balloon image then send a collision signal (1 or -1).
- If collision signal is true then capture the speed at the point of collision.
- Calculate the average x and y colour track speed at the point of collision.
- If speed at the point of collision is greater than a threshold value then send a signal to the switch object.
- If the switch object receives a signal send 1 to switch gate to make balloon image disappear.
- Wait 2 seconds before switching back to original gate displaying the balloon image on screen again.
No comments:
Post a Comment