I'm running a sketch in fullscreen mode on a Mac. The user has to control the sketch using the keyboard.
On a Mac you can quit a sketch using the "command+q". I don't want the user to do this, so do you have any idea how to block all system related shortcuts on a keyboard?. Probably this is rather a question for a mac-user forum, but I hope you have some ideas!!
in my sketch I want to capture an image with my webcam (just one single image not an image capturing all the time).
After that I want to place an animation on top of it. So in the sketch below you should take a picture and then an ellipse moves over the screen and over the image.
My Problem: For an animation I think I need to call "background" all the time. When doing this my captured image from the webcam is gone, as the background lays over it. Is there any simple way to work around this problem?
This would be great!!
import processing.video.*;
boolean animation = false;
int ellipseX = 0;
Capture myCapture;
void setup() {
size (800, 600);
smooth();
noStroke();
myCapture = new Capture(this, width/3, height/3, 30);
I'm working with the Keystone Library and I want to move and control the two layers seperately. So when pressing 'c' I only want to move and control the red layer and when pressing 'v' only the green layer should be moved.
As it's much easier to control the position of the layers when only one layer is selected.
I hope you guys may help me!!! When executing my script both layers are moveable when pressing either 'c' oder 'v'.
Running the sketch like this it saves the xml inside my data folder and creates new subfolders calledVolumes/Public/Test and inside the "Test" folder it saves the xml.
How do I get it to not create new folders but take the given destination and save it there?
import proxml.*;
int posX;
int posY;
XMLInOut xmlIO;
proxml.XMLElement xmlPulses;
void setup() {
size(400, 400);
xmlIO = new XMLInOut(this);
try {
xmlIO.loadElement("test.xml");
}
catch (Exception e) {
xmlEvent(new proxml.XMLElement("pulses"));
}
}
void xmlEvent(proxml.XMLElement element) {
xmlPulses = element;
}
void draw() {
background(0);
posX = mouseX;
posY = mouseY;
}
void mousePressed() {
saveData();
}
void saveData() {
proxml.XMLElement newPulse = new proxml.XMLElement("datensatz");
xmlPulses.addChild(newPulse);
proxml.XMLElement value1 = new proxml.XMLElement("value1");
proxml.XMLElement value2 = new proxml.XMLElement("value2");
I have a xml file containing some data and a processing sketch to read this data.
Want I want to do:
In my xml file I have several childs containing 4 attributes: Name, Surname, Age and City.
First I want to display the Name, 1 second later the surname, 1 second later the age and another second later the city. This animation has to work for the first three childs in my xml file at once. After about 6 seconds it has to display the 4th, 5th and 6th entry. And so on and so on. So no matter how many childs are in my xml file I only want to display three at one time.
Right now I am able to read through my whole xml file and get all of the children. But I only want the first three to appear with the animation of first showing the name, then the surname, age and the city.
Second Problem: As I want this as an animation I need to write my script into the draw(). Sadly the text becomes quite ugly as it overwrites the text every time it loops through draw.
Do have any suggestions how to figure this out? Do I need to use arrays or something to address the text outside the loop? I tried to work with pullMatrix () and pushMatrix() but this doesn't work.
So below you'll find my code so far and the content of my xml file. I'm glad for any help!!!!!
i'm just working on some webcam capturing. It basically works fine so I use the built-in webcam of my macbook and display the image on the screen. But: As soon as I run the sketch on fullscreen the frameRate breaks down from 33 to 4 or 5 fps. I tested without using the filter(); -- this improved to frameRate up to 10 fps. But I need the captured image to be grayscale, so I don't want to get rid of this.
Do you have any suggestions how to keep the frameRate high? At least a few more fps than now.
I started working with the Keystone library (great!!!!)
When working with the basic example "Corner Pin" I asked myself how to change the form of the layers from a rectangle to a triangle. Right now you have a white rectangle with a green-filled circle in it. How can I change the form of the layer from a rectangle to a triangle? So do I have to change something about the createGraphics()?
I set up a grid of ellipses and now want to create this particle effect while the mouse "flows" over the ellipses. So as soon as the mouse comes closer to an ellipse this one has to grow in size and other ellipses around have to go back to their normal size.
I'm not sure whether this is the right way, so to put all my code in the "draw". Or do I have to work with arrays to address each ellipse individually when the mouse comes closer? Thanks for your help in advance!!!
I just have this code and to draw all the lines I use mouseX and mouseY.
Now I just want to start the programm and see how the lines grow without using the mouse. Do you have any experience how to simulate mouseX and mouseY? I tried to use random, but this does not give a nice effect at all.
I just want to save images from my current sketch to a specific folder outside my sketch folder.
It nearly works when using this code to save.
void keyReleased() {
imageCount ++;
if (key == 's'') save("/Users/myName/Desktop/test-file/data/"+saveFile("imageName"+imageCount+".png"));
}
When running this script it saves the image inside the "data" folder, but builds up several more subfolders. So when looking for the saved image I find it inside: "Users/myName/Desktop/test-file/data/
Users/myName/Desktop/test-file/data". Any ideas why this happens? I don't want all these subfolders rebuilded in the original data folder. I just want to save all images in the data folder addressed within the save-function.