I would like to have some text follow the path of a spiral, such that whenever it has gone 180 degrees along the spiral, it is upside down. (This means, for example, that when it has gone 90 degrees, it will be perpendicular, with the bottom of the text facing left.) What I can't work out is how to coordinate the expanding radius of the spiral with the degree of rotation of the text. (Also, I want the time it takes to complete one cycle of the spiral to be constant.)
Here's what I have so far (the chosen values are just stabs in the dark):
float r = 0; //radius
float theta = 0;
PFont font;
void setup() {
size(800, 800, P3D);
background(255);
smooth();
font = loadFont("Georgia-48.vlw");
textFont(font);
textAlign(CENTER);
textSize(24);
fill(0);
}
void draw() {
background(255);
// Polar to Cartesian conversion
float x = r * cos(theta);
float y = r * sin(theta);
// Draw an ellipse at x,y
// Adjust for center of window
translate(x+width/2, y+height/2, 0); //rotation of the disk
rotate(radians((r * 23) % 360), 0, 0, 1 ); //rotation of the word
I'm using the latest version of Processing and an example file from the latest version of SuperCollider for Processing (which is admittedly not very recent).
I have a class from which I'm building an array and would like to write a function that identifies the index number of the object within the array and displays that number (i.e. via the text function). In other words, the class method 'display' includes displaying the index number. Is there a way to do this?
When Processing starts up, it opens a blank window that for my taste and my monitor is too small. It would be great if we could set a default window size somehow.
I'm wondering if someone can tell me why the code below generates the first image I've included, whereas if I include P3D in the size function, it generates the second image. As far as I can tell, I'm not using any functions that depend on 3D info.
Can someone tell me what is the easiest and most reliable way to trigger 60 one-minute audio files one after another? I've worked a bit with Minim in the past, but it's not clear to me what is the best way to proceed.