Although advertised differently even the best HD webcams like the Logitech Quickcam Vision (for Mac) don't let me capture on 25 or 30fps on HD resolution (Logitech has a lot of "HD" sizes).
Great to see that adding controllers by annotations is now supported by ControlP5 natively. I've found out the possibility by the
CP5magic announcement of Toxi but I could get it to work. Luckily I've found out that its now implemented in ControlP5 itself.
I'm trying to mask a texture (webcam image) with a drawn mask. I'd like to get the same effect as the
processing mask function.
However working with a grayscale image doesn't seem to work. I now draw the mask with a cutout (breakshape) to make my mask working, however I cannot soften the edges.
See code below:
// Generate maskTexture
maskTex = new GLTexture(parent, imageSize, imageSize);
// Generate maskedTexture
maskedTex = new GLTexture(parent, imageSize, imageSize);
With the mask method in Processing I just drew a triangle and blurred it and it work fine. Below the drawing code. I'd like to be able to use this as a mask in GLgraphics (softened edges).
// Generate mask
pg = createGraphics(imageSize,imageSize,JAVA2D);
pg.beginDraw();
pg.background(0); // black
pg.smooth();
pg.noStroke();
pg.fill(255);
pg.pushMatrix();
pg.translate(translateX, translateY);
pg.triangle(x1, y1, x2, y2, x3, y3);
pg.popMatrix();
pg.endDraw();
pg.filter(BLUR, 4);
Can I use alpha masks with GLGraphics ? And if yes how?
And if not why I still see a stroke of 1 pixel when masking?
I'd like to keep using GLGraphics because its way faster.
The code I currently use (uses GSVideo and GLgraphics):
I'm building an OSC monitor/patcher that has to be able to listen to mulitple ports.
As far as I found out that will be only possible by making multiple OscP5 objects that each listens to their own port. I've tested this with 2 ports and that works perfect.
However all objects call the oscEvent function. Is there a way to see which OscP5 object triggered the oscEvent function? Or to get more details from the OscMessage?
I've looked into the documentation the only thing I've found that came close was the OscMessage
print() method.
This is what I its prints for a message send to port 8000:
-OscMessage---------- received from /192.168.0.101:63405 addrpattern /1/fader1 typetag f [0] 0.30240548
And this for a message to port 3333:
-OscMessage---------- received from /192.168.0.104:50643 addrpattern /tuio/2Dcur typetag si [0] fseq [1] 1330
The port is not similar it seems? The ip-adres is correct.
Questions:
Can I get the port and/or the ip-adress from the message with a certain method?
Is it smart to listen to multiple ports by making multiple OscP5 objects? Is there a certain limit of objects that can be run or is this just trial and error?
I've understood that its is easy to send messages to different ports by using the Flush() method. Is that right? Or would using multiple netAdress objects be a better idea as stated in this example on the Processing forum.
However have some problem to convert incoming string to a custom OSCMessage. It seems that OscMessage doesn't recognize the incoming part of the String.
String received from Scratch: sensor-update "position" -87.0
Could it be an encoding problem? Since Scratch encodes strings as UTF-8.
Or is it related to the library?