I just took the movie sample code from the Processing website, and when I want to run it using my own movie (for which I also changed the height and width of the canvas, it gives me the error: ArrayIndexOutOfBoundsException: Coordinate out of bounds! What could possibly be wrong?
My question is really simple yet hard to find out with experimenting..
I want to do the following:
I have a 3D bird flying to the rhythm of music using minim line in.
To be more specific, it flies up and down. (Low sound = bird flying low, high sound = bird flying high)
Yet it's not moving smooth, it moves too fast to my liking. The logic thing that I would do is to use frame rate to slow it down but that makes the movement look like a slow browser loading an animation.
I hope it's clear what I'm asking here, anyone knows what function I should be looking for?
This is kind of annoying as I am not getting any errors - I am trying to load an .obj file with this simple code but all I get is a gray area. Here is the code:
/*
Load a scene from an .obj file as simple as it gets.
model is the free Sponza Atrium by Marko Dabrovic:
I have found this code on the internet, and I am working on my own audio visualiser. Everything works but I want to apply a smooth movement. (for instance if you would take the example I post here with eclipses slowly appearing, in my example they would appear at the moment of sound without fading in and out)
I think it has to do with the 'flux' part or Open GL.. So the following code is NOT the code that I have written, but the code that contains a 'fade' statement somewhere I can't figure out. Hope someone can tell me what part it is about the code that I need.
In this example, a cloud moves when someone blows or speaks into the mic. I want to make the same but with my own image. I got this far but I cannot get the image to move like the cloud does.
I am playing around with Reactivision and TUIO. Every fiducial has its own ID and I'm looking for the right name in Processing to connect every fiducial with its own image. I know how to use, load and draw images but I simply cannot find out how I should call my fiducials. I read in the documentation that the fiducial ID is called Symbol ID but I don't understand how I can say the following:
if ( *FIDUCIAL ID* == 0) {
image(img,0,0)
}
Here is my code:
// we need to import the TUIO library
// and declare a TuioProcessing client variable
import TUIO.*;
TuioProcessing tuioClient;
// these are some helper variables which are used
// to create scalable graphical feedback
float cursor_size = 15;
float object_size = 60;
float table_size = 760;
float scale_factor = 1;
PFont font;
PImage p0;
void setup()
{
//size(screen.width,screen.height);
size(640,480);
noStroke();
fill(0);
loop();
frameRate(30);
//noLoop();
p0 = loadImage("p0.jpg");
hint(ENABLE_NATIVE_FONTS);
font = createFont("Arial", 18);
scale_factor = height/table_size;
// we create an instance of the TuioProcessing client
// since we add "this" class as an argument the TuioProcessing class expects
// an implementation of the TUIO callback methods (see below)
tuioClient = new TuioProcessing(this);
}
// within the draw method we retrieve a Vector (List) of TuioObject and TuioCursor (polling)
// from the TuioProcessing client and then loop over both lists to draw the graphical feedback.
First of all I am a complete noob, so sorry if my question seems really stupid or hard to answer.
What am I trying to do is the following:
For my gradutation project I am working with my own music, I want to make an original graphical application or something really fun to do. So I stumbled on Reactivision and the recognition of fiducials with a lot of possibilities.
Currently I am trying something very basic which doesn't seem to work at all, no matter what I try: the fiducials will be recognized through Processing, starting up an image. If I'll be able to do this, I can work with sound and movies. An image just seemed something very easy to start with. I found
this tutorial online of people who used the same principal in a presentation.
So I adjusted the code to what I'm trying to do and came up with this:
import ddf.minim.*;
import ddf.minim.signals.*;
import ddf.minim.analysis.*;
import ddf.minim.effects.*;
import hypermedia.video.*;
import processing.video.*;
import TUIO.*;
import java.util.*;
//Capture myCapture;
OpenCV opencv;
Minim minim;
AudioPlayer s7;
PImage p0;
int W = 640;
int H = 480;
float wmax;
float hmax;
Hashtable playing;
TuioProcessing tuioClient;
void setup(){
size(W,H);
wmax = W/2;
hmax = H/2;
frameRate(30);
playing = new Hashtable();
minim = new Minim(this);
tuioClient = new TuioProcessing(this);
initContent();
opencv = new OpenCV( this );
opencv.capture( width, height );
//myCapture = new Capture(this, width, height, 30);
But as they say in the tutorial, the code is made up very quick in one afternoon because they didn't have enough time. Therefore the code is very difficult and confusing, which doesn't make it easier for me. As I expected my code doesn't work, the only thing I can do is show my fiducials through the webcam on Reactivision and Processing at the same time, Reactivision recognizes them but Processing doesn't do anything.