What am I doing wrong? If/else statements based on mouse speed.

So I am trying to work on this "game" for a school project. The goal is to click the object, but if you're moving too fast the object moves away from your mouse. If you're moving slowly it will stay put. Some kind of metaphor on patience being a virtue or working hard toward a goal vs taking shortcuts...

Anyway, my problem is coming from the if statement I think. no matter how low I set the speed the circle still moves. Here is what I've got:

float x, y; boolean move=false; float mouseSpeedX; float mouseSpeedY; void setup() { size(800, 600); newPosition(); mouseSpeedX = abs(pmouseX - mouseX); mouseSpeedY = abs(pmouseY - mouseY); } void draw() { background(245); if (mouseSpeedX < 1) { PVector p = new PVector( mouseX-x, mouseY-y, 0); p.limit(15); if (move && dist(mouseX, mouseY, x, y)<150) { x-=p.x; y-=p.y; } // if (mouseX>x-60 && mouseX<x+60 && mouseY>y-60 && mouseY<y+60) { // newPosition(); // } } x = constrain(x, 25, width-25); y = constrain(y, 25, height-25); smooth(); fill(216, 85, 85); noStroke(); ellipse(x, y, 75, 75); smooth(); } void mouseMoved() { move=true; } void newPosition() { x=random(width); y=random(height); } 

Another thing I've been struggling with is a visual metaphor for this... so it isn't just a mouse clicking a circle. So if you guys have any ideas for that too, I would love to hear them.


submitted by PxlWolf
[link] [comment]

The Final Post: Computer Evolution on Law and Order


 The first computer on the show (1,1).

Combining endurance performance art and media studies, artist Jeff Thompson captured over 11,000 images of the show Law & Order while watching the complete original series over the course of 18 months, often at an increased frame rate in order to save time. Through these images, he tracked the computer's changing role on the show from its debut as a static background prop to its starring role as the focus of characters' attention and the basis of plotlines. Those images have been published to a Tumblr on an ongoing basis since the launch of the project; the final post went up today.

Clunky monitors slowly move to the front of the desk (5, 89)

Computers on Law & Order was created per a Rhizome commission in 2012 — an apt time to analyze the ongoing interdependence of technology and daily life. As Thompson immersed himself in television drama's interpretation of the rise of the internet and the appearance of the Blackberry, real-world consumers were being influenced by appification and the mainstream prevalence of the cloud. The ability to “binge watch”—coupled with the power to stream comfortably with near immediacy—is what ignited Thompson’s initial interest in the project; after obsessive detailing and the creation of logical infographics, his ultimate findings sound like an anthropological study of American culture:

Law & Order is an even more interesting cultural artifact than I could have ever expected. The show forms a unique database of images and speech, and one that reflects the fascinations, fears, and biases of its time. Law & Order's long run and its ‘ripped from the headlines’ content makes it a useful lens through which to look at a period of great political and economic change in the United States.”

In addition to the Tumblr, a curated book of image selections was self-published by the artist last year, along with an accompanying essay on Rhizome.

 A still from Law and Order episode #456, 2010

A still from Law and Order episode #456, 2010

Resounding Reaction 01

This Processing sketch sound bridges the gap between human and computer and allows the user to see a physical representation of the volume of sound present at that moment. The image generated slowly fades away as more and more sounds are layered on top. By moving the mouse across the screen, the size and radius of the shapes can be altered– all while they pulse along to present sounds in the room.

Cast: CIID IDP and Karan Chaitanya Mudgal

Tags: processing

[Question] Revealing an image from a black background

Hey guys,

I'm currently working on an Arduino Uno and Processing interface with the idea of revealing an image much like a "scratch off lottery ticket." I currently have the image uploaded into the sketch and the black background ready, however I'm not sure at this point how to start revealing the image through fill()

I know that I could technically use an ellipse of 1 pixel wide that will SLOWLY reveal the image (and subsequently take forever because the Arduino joystick isn't very cooperative.) but I was hoping there would be an easier way to reveal it. Does anyone have any ideas?

Here is a pastebin of the code:


The main function that I realize will do the "unveiling" is the draw function.

Thanks guys, any help is appreciated

submitted by Zulabro
[link] [comment]

La rhétorique peut casser des briques

La rhétorique peut casser des briques est une version de Tetris où vous pouvez utiliser des commandes vocales en parlant dans un téléphone pour diriger les pièces. Les commandes basiques sont Gauche, Droite, Tourne et Tombe.
Le joueur ne peut employer qu'une seule fois chaque commande, l'obligeant à user de toutes les ressources de la langue (noms d'hommes politique, vocabulaire marin, synonymes, antonyme, etc). Les commandes sont inscrites sur un carnet d'adresse pour ceux qui souhaitent tricher.


Rhetoric can break bricks is a version of Tetris where you can use speech commands to move pieces. Basic commands are Left, Right, Turn and Fall. You can also try with sentences, synonyms, antonyms, or figures of speech.


Cast: Florent Deloison

Tags: art, jeu, jeu vidéo, game, numérique, tetris, processing and installation

Scenografie virtuali per l’opera teatrale “Io l’ho sempre chiamata Patria” di Marco Filatori – 2015

Scenografie virtuali per l’opera teatrale “Io l’ho sempre chiamata Patria” di Marco Filatori – 2015 .
Apple MacBook Pro, videoproiettore, 17 filmati HD 720P (1280x720, 25fps), software di automazione spettacolo.

Manlio Francesco Tartara
Programmazione software automazione spettacolo, motion graphics, editing e ambientazioni sonore.

Domenico Sestito

Cast: ProvocActionArt

Tags: Pertini, prima guerra mondiale, theatre, teatro del battito, processing, video mapping and first world war

[HELP] urgent. Creating pdf wont work

when i run the code the PDF i am left with is just a blank white PDF. i cant find any issues with it so i was hoping you guys could help a struggler out

heres my code:

 //this code is heavily based off the library example code //for the cell noise library /* Importing the library. */ import CellNoise.*; import processing.pdf.*; CellNoise cn; CellDataStruct cd; double[] at = { 200, 1000 }; double t = 0; PImage im; int x, y, i; //THESE 2 FLOATS ARE THE KEY TO THE CHANGING DESIGN. DECLARING THE FLOAT INDICATES THAT EVERY LITTLE //DECIMAL IN BETWEEN MAY BE USED. THIS TOOK WAY TOO LONG TO FIGURE OUT. float yPos = random(0.001,0.016); float xPos = random(0.0008,0.02); float ab = random(18, 20); float ba = random(450, 700); void setup() { size(800, 1000); noLoop(); beginRecord(PDF, "filename.pdf"); //size(4961,7016); cn = new CellNoise(this); cd = new CellDataStruct(this, 2, at, cn.EUCLIDEAN); } void draw() { loadPixels(); //this affects the progressive "noisiness" of the image. key in changing the outcome of //both the more solid and more noisey design. t = 0; for (x = 0; x < width; x++) { at[0] = xPos * ( x + ab); for (y = 0; y < height; y++) { at[1] = yPos * ( y + ba ); cd.at = at; cn.noise(cd); //NOISEY NOISE at[0] = 0.01*cd.F[0] * (x + 20); at[1] = 0.01*cd.F[0] * (y + 700); cd.at = at; cn.noise(cd); /* the code i have commented out here looks just too pixelated with no smoothe transitions especially when using random variables therefore i have replaced it with code used to create a block colour texture seen in the MANHATTAN style of noise as opposed to the EUCLIDEAN using the best of the two styles. */ //pixels[x + y*width] = color((float)(cd.F[0])*random(30,40), (float)(cd.F[0]+cd.F[1])*random(130,150), (float)(cd.F[0])*random(100,130)); pixels[x + y*width] = color((cd.ID[0] % 255), (cd.ID[0] % 100), (cd.ID[0] % 100)); } } updatePixels(); endRecord(); } 
submitted by dchessari
[link] [comment]