I want to creat a simple button but with a rect which rotate with a pushMatrix/popMatrix transformation. Of course I can't use my overRect() method in this condition, but do you know how I can do ? Thanks !
color over = color(200, 0, 0); color out = color(0); color temp;
void draw() { rectMode(CENTER); int w =20, h =30; int x =50, y =30; pushMatrix(); translate(x, y); rotate(PI/5); fill(temp); rect(0, 0, w, h);
if (overRect(x, y, w, h)) { temp = over; } else { temp = out; } popMatrix(); }
boolean overRect(float x, float y, int w, int h) { if (mouseX >= x - w/2 && mouseX <= x + w/2 && mouseY >= y - h/2 && mouseY <= y + h/2) { return true; } else { return false; } }
my problem is to know how to detect when the phone screen is touching, because when I'm using the mouseX and mouseY values, it's always the same value even when I doesn't touch the screen :-(.
I have make a kind of sketches compilation for processing-android. You can find thishere.
Thanks to all the contributors, because there is a lot of code taken from here or other blog, I have just tried to do a kind a code pack. (and some bonus too :) )
Into this depository, you can find code on : OSC, SENSORS, AUDIO... sometimes using library like Ketai or APwidgets some times with the Android SDK...
As someone already done some tricks with Amarino under processing ? Maybe Amarino could be a solution to use easily bluetooth between android and arduino, and between two android phones too ?
I'm trying to re-built the ketai library under linux, because I have meet some problem with my spica phone for accessing to the camera. So i've modified the KetaiCamera class, and now I just want to re-build another jar file. I do that with eclipse. All looks OK except than there is an error in 3 java files in the ketai lib (Ketai.java, KetaiLocationManager.java and KetaiSensorManager.java).
is it line 1 ? line 14 ? chapter 14 ?... For now I have just changed the project name and and the basedir but the build Failed in this way:
BUILD FAILED /home/algo/Bureau/ketai/resources/build.xml:95: The following error occurred while executing this line: /home/algo/Bureau/ketai/resources/build.xml:119: /home/algo/Documents/Processing/libraries not found.
Another question ... Sorry for being very curious, but I explore processing-android from the south to the north. I have to do a kind of workshop next week about interactivity with android and processing, that's why I'm looking into different way of developping applications, use sensor... So, my next question is about gestures recognition. I've built GESTURE_BUILDER on my spica, and it's all right. But now I want to create an application to recognize gestures.
the problem it's that all the recognition activity take effect with the GestureOverlayView class, that is a kind of layout at the top of the other layout. Unfortunately I believe Processing is only 1 layout, and so I can't use GestureOverlayView and any other layout. Do you think there is a way to implement gesture in processing without rebuild all the recognition system ?
I have a bug using oscP5 on processing 1.2.1, ubuntu 10.04. Really simple test program :
import oscP5.*;
import netP5.*;
OscP5 oscP5;
NetAddress MyBroadcastLocation;
void setup() {
size(400,400);
oscP5 = new OscP5(this,12000);
MyBroadcastLocation = new NetAddress("192.168.0.14", 12000);
}
void draw() {
}
/* incoming osc message are forwarded to the oscEvent method. */
void oscEvent(OscMessage theOscMessage) {
/* get and print the address pattern and the typetag of the received OscMessage */
println("### received an osc message with addrpattern "+theOscMessage.addrPattern()+" and typetag "+theOscMessage.typetag());
theOscMessage.print();
}
Return me :
processing.app.debug.RunnerException: FileNotFoundException: /usr/lib/jvm/java-1.5.0-sun-1.5.0.19/jre/lib/zi/localtime (No such file or directory) at processing.app.Sketch.placeException(Sketch.java:1628) at processing.app.debug.Runner.findException(Runner.java:584) at processing.app.debug.Runner.reportException(Runner.java:560) at processing.app.debug.Runner.exception(Runner.java:500) at processing.app.debug.EventThread.exceptionEvent(EventThread.java:367) at processing.app.debug.EventThread.handleEvent(EventThread.java:255) at processing.app.debug.EventThread.run(EventThread.java:89) processing.app.debug.RunnerException: FileNotFoundException: /usr/lib/jvm/java-1.5.0-sun-1.5.0.19/jre/lib/zi/GMT+01:00 (No such file or directory) at processing.app.Sketch.placeException(Sketch.java:1628) at processing.app.debug.Runner.findException(Runner.java:584) at processing.app.debug.Runner.reportException(Runner.java:560) at processing.app.debug.Runner.exception(Runner.java:500) at processing.app.debug.EventThread.exceptionEvent(EventThread.java:367) at processing.app.debug.EventThread.handleEvent(EventThread.java:255) at processing.app.debug.EventThread.run(EventThread.java:89) processing.app.debug.RunnerException: FileNotFoundException: /usr/lib/jvm/java-1.5.0-sun-1.5.0.19/jre/lib/zi/GMT+01:00 (No such file or directory) at processing.app.Sketch.placeException(Sketch.java:1628) at processing.app.debug.Runner.findException(Runner.java:584) at processing.app.debug.Runner.reportException(Runner.java:560) at processing.app.debug.Runner.exception(Runner.java:500) at processing.app.debug.EventThread.exceptionEvent(EventThread.java:367) at processing.app.debug.EventThread.handleEvent(EventThread.java:255) at processing.app.debug.EventThread.run(EventThread.java:89) ### [2011/3/22 12:43:11] PROCESS @ OscP5 stopped. ### [2011/3/22 12:43:11] PROCESS @ UdpClient.openSocket udp socket initialized. ### [2011/3/22 12:43:12] PROCESS @ UdpServer.start() new Unicast DatagramSocket created @ port 12000 ### [2011/3/22 12:43:12] PROCESS @ UdpServer.run() UdpServer is running @ 12000 ### [2011/3/22 12:43:12] INFO @ OscP5 is running. you (127.0.1.1) are listening @ port 12000 ### [2011/3/22 12:43:26] PROCESS @ OscP5 stopped. ### [2011/3/22 12:43:26] PROCESS @ UdpServer.run() socket closed.
It's a problem about timezone, but what i can do ? Thanks
I'm using processing.android 0192, android 2.1 on my phone and API 7.
I'm under ubuntu Lucid 10.04.
I'm trying to access my Galaxy Spica's camera. Successfully with a java example implementation of akeric (thanks to him), but without success with ketai library. I have only a white screen on my phone.
Somebody knows the same problem ?
Another question is about the ketai FaceAnalyzer.java in the library core... Ketai is using Android OpenCV port ? because i have found an old CameraManager.java in the /trunk with this into :
import org.siprop.opencv.OpenCV;
What about this in Ketai now ? there is OpenCV or another stuff for faceAnalyzer example maybe ?