Good morning everyone.
I have a question about a video capturing program.
In this program, when I press Space, the webcam should show the images on the screen.
But when I start the program with the play button, I first have to click with the mouse on the frame.
If I press Space before clicking on the frame, nothing happens.
What should I do?
Thanks
Good evening to all.
I wanted to create a simple jigsaw puzzle of 4 pieces, but I can't figure out how to realize it.
To make it simplier, I wanted to switch the pieces by clicking on them.
Is there an easy way to realize it?
Thanks in advance.
Good evening to all.
I've realized a simple game in which some viruses fall down, and the Avira umbrella have to repulse them.
I wanted to add a screen before starting the game, in which I wanted to write something like: "Alert, some viruses wants to infect your pc, press SPACE to repulse them" with an alert sound in background, and after pressing space, the game begins.
Could someone please suggest me how to do this?
The code is this:
PImage umbrella; PImage virus; PImage desktop; float posXvirus; float posYvirus; float PosYumb; int comincia; int continua; int infezione; int vittoria; PFont font;
Good morning.
I'm a new user of Processing and also a new user in this forum.
I wanted to create a program in which if a person in front of a webcam raise his finger and touch a photo, the photo will zoom at the center of the screen.
Something like this (the person shoul not be displayed, of course):
Now, I have this code, and I wanted to create this project.
Could you give me a hand?
Thanks a lot.
import processing.video.*;
int numPixels; int[] backgroundPixels; int[] hist; int[] histTop; Capture video; int pressed=0; float presenceSum=0;
void setup() { size(640, 480, P2D);
video = new Capture(this, width, height, 24); numPixels = video.width * video.height; backgroundPixels = new int[numPixels];
loadPixels(); }
void draw() { if (video.available()) { video.read(); video.loadPixels();
hist = new int[width]; float maxval = 0; int maxposx=0; int maxposy=0;
for (int i = 0; i < numPixels; i++) {
color currColor = video.pixels[i]; color bkgdColor = backgroundPixels[i];