I need to create a PGraphics object in a library I am developing and I am not able to figure it out. I can declare a PGraphics variable just fine but I do not understand how to call the createGraphics method.
I would like the individual points in my point cloud to each have different a size, and I would like to modify these sizes over time. All I could find was sys.setPointSize(float) but this applies to all the points. Can they be controlled individually?
I need a command like bezierDetail() or curveDetail(), but for the ellipse drawing command in GL. I have some pretty extreme transforms on it, and when it is drawn on screen, you can see the decimation. I need to subdivide it more but haven't been able to find a way.
I'm posting this code here because I've been wanting to do this for a long time and had a very hard time figuring out how to get it to work. Hopefully, this will save others some time... It walks you through the steps needed to let a flickr user using your app tell flickr to authorize your app. Before you start, you need to create an app in flickr and paste the proper key and secret in the pde. After that, run the sketch. If you follow the printed directions, you should be good.
// -Log into flicker
// -Get an API key for a new app
// -Set the following variables appropriately
String SECRET = "paste the secret here";
String KEY = "paste the key here";
// Authorization variables
String frob;
String token = "paste the token you get from the first run here";
String search = "cars";
// Array list to hold flickr image URLs
ArrayList pix;
void setup() {
size(300, 300);
background(0);
smooth();
pix = new ArrayList();
println("If you need to go through the authorization process, press \"r\" to request a frob and print out the URL to the proper flickr page");
println("If your \"token\" variable is already set from pasting the value from previous runs of the sketch, press \"g\" to start the slide show\n");
This may be more a java question than a processing issue, but I am deciding on an OS for some generative art displays. I am using some atom 330/ION nettops and finding that similar sketches are about twice as fast on win7 than they are on ubuntu (same machine). I am using processing1.2.1, the official sun version of java, the latest nvidia drivers.
I don't want to have to use win7 for this project but the speed different is significant enough that I may have to. Can anyone shed any light on this?
I have a polygon which I am duplicating x number of times according to arbitrary rule. Ideally, I would just like to have an ArrayList with each element being a function pointer to the transform I want to apply. Unfortunately, from what I can tell trying and failing to figure it on my own, java's implementation is not that straight forward. I gather I need to use anonymous classes but I'm not sure how to get it to work.
Here's some pseudo code:
void setup() {
size(400,400);
// define a polygon
PVector[] verts = { new PVector(0,0),new PVector(50,0),new PVector(25,50)};
// I have my transforms as strings, but ideally, they would be function definitions
ArrayList xform = new ArrayList();
xform.add("translate(50,50)");
xform.add("combo(-100,0,PI*.333)");
xform.add("scale(2,1)");
// draw my original triagle
drawIt(verts);
//apply the first transform and draw
xform.get(0); // this would apply the transform
drawIt(verts);
//apply the second transform and draw
xform.get(1);
drawIt(verts);
//apply the third transform and draw
xform.get(2);
drawIt(verts);
}