Reactivision and Processing maze
in
Contributed Library Questions
•
1 year ago
Hello guys,
I have created a maze with Processing and Reactivision. A fiducial symbol would guide the player through the black walls of the maze.Everything went fine so far.
At this point I am having problems though. The symbol that's represented by an ellipse on screen is not supposed to
cross the black lines of the maze.
Also, the symbol is supposed to start at the left bottom corner of the maze. How do I put it there when the program starts up?
I am a bit stuck with the code.
Can someone perhaps help me out with it?
I'd appreciate any advice.
Here is my code so far.
- import TUIO.*;
TuioProcessing tuioClient;
float object_size = 60;- PImage maze1;
void setup()
{
size(640,480);
noStroke();
fill(0);
loop();
frameRate(30);
//noLoop();
maze1 = loadImage("maze.png");
tuioClient = new TuioProcessing(this);
}
void draw()
{
background(maze1);
float obj_size = 32;
Vector tuioObjectList = tuioClient.getTuioObjects();
for (int i=0;i<tuioObjectList.size();i++) {
TuioObject tobj = (TuioObject)tuioObjectList.elementAt(i);
stroke(0);
fill(0);
translate(tobj.getScreenX(width),tobj.getScreenY(height));
ellipse(-obj_size/2,-obj_size/2,obj_size,obj_size);
fill(255);
}
Vector tuioCursorList = tuioClient.getTuioCursors();
for (int i=0;i<tuioCursorList.size();i++) {
TuioCursor tcur = (TuioCursor)tuioCursorList.elementAt(i);
Vector pointList = tcur.getPath();
}
}
1