It seems that Twitter API changed from 1.0 to 1.1, and some features do not work. In my code I receive the status error 410. Does anyone knows how can this be fixed? Here is some of the code I use.
Is there a possibility to read in Processing a number of sound streams in .m3u format (around 5)? Has someone already done something like this, and maybe wants to share his/her experience, any tips, or comments?
Adding a video with GSVideo library I have a drop from 60 frames to 50, and if I add a second video that plays simultaneously it drops to 8 (!). Are there any optimization techniques to avoid this issue? Also it is weird because I use the GL texturing method which is supposed to be a lot faster.
Any comments or suggestions working with multiple video in Processing, or we have reached current limitations?
I am trying to set multiple videos and trigger each one of them with TUIO, but the following procedure does not work, as it displays the first video ok, but when I add a second, third and so on it displays wrong videos. Can you point out where this is wrong?
So, I wanted to do a very simple thing, which turned out to be a disaster. I wanted to use two different sketches that communicate over OSC, and from the first to press a button, and wait on the second sketch to trigger one item in the Arraylist to appear on screen. Following I have the two sketches so that you can follow my idea.
The Arralist is triggered perfectly when is on the same sketch, but it does not work on two different sketches. The difference is that in the first case I evaluate a boolean - when true add a new item to the Arraylist - but in the second case I send a variable (1 or 0) to evaluate on the second sketch. This does not seem to work.
Any ideas???
int b = 0;
boolean captured;
boolean isOverSomething;
ArrayList shapeMove = new ArrayList();
Button button;
import oscP5.*;
import netP5.*;
OscP5 incomingOSC;
OscP5 oscP5;
NetAddress myRemoteLocation;
int intButtonEnter = 0;
void setup(){
size(800, 500);
button = new Button(200, 300);
oscP5 = new OscP5(this,12000);
myRemoteLocation = new NetAddress("127.0.0.1", 12000);
}
void draw(){
background(255);
button.display();
}
void mousePressed(){
if( button.pressed() ){
intButtonEnter = 1;
} else {
intButtonEnter = 0;
}
OscMessage setNewCapsule = new OscMessage("/output");
setNewCapsule.add(intButtonEnter);
oscP5.send(setNewCapsule, myRemoteLocation);
//println(intButtonEnter);
}
class ShapeMove{
int x;
int y;
int h;
int w;
int origx;
int origy;
int deltax;
int deltay;
int posXdiff;
int posYdiff;
int xdragdelta;
int ydragdelta;
boolean over;
boolean locked = false;
boolean imCaptured = false;
boolean overMe = false;
ShapeMove(int _x, int _y, int _h, int _w) {
x = _x;
y = _y;
h = _h;
w = _w;
}
void isover() {
if (mouseX >= x && mouseX <=x+w &&
mouseY >= y && mouseY <= y+h) {
over = true;
isOverSomething = true;
} else {
over = false;
isOverSomething = false;
}
}
void overme() {
if (isOverSomething) {
if (overMe) {
if (!over) {
overMe = false;
isOverSomething = false;
}
}
} else {
if (over) {
overMe = true;
isOverSomething = true;
}
}
}
void update() {
if (over && mousePressed && !imCaptured && !captured) {
deltax = x - mouseX;
deltay = y - mouseY;
origx = x;
origy = y;
captured = true;
imCaptured = true;
}
if (!mousePressed && imCaptured) {
captured = false;
imCaptured = false;
}
if (imCaptured) {
xdragdelta = x - (mouseX + posXdiff);
ydragdelta = y - (mouseY + posYdiff);
x = mouseX + deltax;
y = mouseY + deltay;
}
}
}
class Button{
int rectX, rectY; // Position of square button
int rectSize = 50; // Diameter of rect
color rectColor;
color rectHighlight;
boolean rectOver = false;
Button(int _rectX, int _rectY) {
smooth();
rectColor = color(0);
rectHighlight = color(51);
rectX = _rectX;
rectY = _rectY;
}
void display() {
update(mouseX, mouseY);
if (rectOver) {
fill(rectHighlight);
} else {
fill(rectColor);
}
stroke(255);
rect(rectX, rectY, rectSize, rectSize);
}
void update(int x, int y) {
if ( overRect(rectX, rectY, rectSize, rectSize) ) {
rectOver = true;
} else {
rectOver = false;
}
}
boolean overRect(int x, int y, int width, int height) {
if (mouseX >= x && mouseX <= x+width &&
mouseY >= y && mouseY <= y+height) {
return true;
} else {
return false;
}
}
boolean pressed(){
if( rectOver ) {
return true;
} else {
return false;
}
}
}
int x; int y; int h; int w; int b = 0;
boolean captured;
boolean isOverSomething;
ArrayList shapeMove = new ArrayList();
int incomingButton;
import oscP5.*;
import netP5.*;
OscP5 incomingOSC;
OscP5 oscP5;
void setup(){
size(800, 500);
oscP5 = new OscP5(this,12000);
incomingOSC = new OscP5(this, 12000);
}
void draw(){
background(255);
for( int i = 0; i < shapeMove.size(); i++ ){
((ShapeMove)shapeMove.get(i)).update();
((ShapeMove)shapeMove.get(i)).display();
}
}
void mousePressed(){
if( incomingButton == 1){
shapeMove.add( new ShapeMove((int)random(0,width),(int)random(0,height), (int)random(10,20), (int)random(10,20)) );
}
}
class ShapeMove{
int x; int y; int h; int w; int origx; int origy; int deltax; int deltay;
int posXdiff; int posYdiff; int xdragdelta; int ydragdelta;
boolean over;
boolean locked = false;
boolean imCaptured = false;
boolean overMe = false;
ShapeMove(int _x, int _y, int _h, int _w) {
x = _x; y = _y; h = _h; w = _w;
}
void isover(){
if (mouseX >= x && mouseX <=x+w &&
mouseY >= y && mouseY <= y+h) {
over = true;
isOverSomething = true;
} else {
over = false;
isOverSomething = false;
}
}
void overme()
{
if (isOverSomething) {
if (overMe) {
if (!over) {
overMe = false;
isOverSomething = false;
}
}
} else {
if (over) {
overMe = true;
isOverSomething = true;
}
}
}
void update() {
if (over && mousePressed && !imCaptured && !captured) {
deltax = x - mouseX;
deltay = y - mouseY;
origx = x;
origy = y;
captured = true;
imCaptured = true;
}
if (!mousePressed && imCaptured) {
captured = false;
imCaptured = false;
}
if (imCaptured) {
xdragdelta = x - (mouseX + posXdiff);
ydragdelta = y - (mouseY + posYdiff);
x = mouseX + deltax;
y = mouseY + deltay;
}
}
void display() {
rect(x, y, h, w);
}
}
public void oscEvent(OscMessage msg) {
if (msg.checkAddrPattern("/output") && msg.checkTypetag("i")) {
Based on the following example, I would like to know how it is possible to create a line that connects the first added ellipse with the second added ellipse (and then the second with the third, the third with the fourth, and so on.
However, in my case I just want to click a button and show the interface (in the posted code example it just shows the second button), and when the second button is clicked, then to show button1 again. The problem is when the second time you try to click button1. You need to click it twice to work. Why is that??
I am working on a sketch that loads around 100 images (640x480) and processes them. I am studying the following example I found on openprocessing.com (sorry can't remember the name of the owner). However, I've noticed performance issues when loading more than 50 images. Can someone have a look and tell me if you can see where the mistake is?
Hello, I checked the forums couldn't find what I was looking for.
How is it possible to split a screen that displays animation/moving images/videos into three different vertical banners; lets say there is a ball moving, how can you make these banners have direct relation with each other? Have a look at the following pics - the first is the normal animation sketch, and the second is what I am looking for.
I know this process is fairly easy with other visual programming languages, but I can't find any clear method to do this in Processing.
I was wondering if you can set the particles fly within a specific area. Ok, I know I can set bounds on a shape such as a rectangle or an ellipse, but what about a complex shape or even an image area (for example stay only within the yellowish area in this image >
http://www.win.tue.nl/~vanwijk/seifertview/fig8one.jpg).
I know this can happen somehow so if you have any tips or suggestions are welcomed. Please let me know if this is complex to do or not, as I am a medium programmer and if this rather more complicated than I expect I must leave it for now due to time limits.
I have this question and I am struggling to find an approach, but I can't find any so far. If someone has a solution, please share it with me.
So, I have this simple code that extracts from a .png image only the pixels that are not transparent, and then draws points every 5 pixels with color taken from that specific area of the image. So far so good, no harm caused.
However, I would like to be able to control the position of each point with motion algorithms based on interaction with the user (i.e. the points start moving when the mouse is closer). How can I control ONLY the points that are drawn from the image - lets assume there are just 200 points that have been created and I want each one to be controlled by the motion algorithms?