Hi everyone. I'm having a really hard time trying to do what it seems to be a pretty simple task: creating an array of rectangles that can be filled with one of four different colors. The screen is "divided" in four regions (upper left, upper right, lower left, lower right) and the rectangle's color is assigned depending on which region it is located.
The problem is I'm getting some rectangles in the upper row with the colors that is supposed to be assigned to the lower row rectangles.
This is my code:
int altura = 1000;
int cuadrado = 100;
float vacio = 99.5;
Cajita cajitas;// = new Cajita [altura/2][altura/2];
size (altura, altura);
cajitas = new Cajita [(altura/cuadrado)][(altura/cuadrado)];
Hi. I need some help with a project I'm working on.
I've developed a sketch with an array of boxes that are modified in its size depending on the input of the webcam. It works with a face detection system, so the boxes that are close to the coordinates of the person in front of the computer, get bigger.
So, what I want to do is to store the animation of the boxes changing its size (for instance, during 60 seconds) and then export thhat animated boxes into a 3dsmax. I hope the objects could get imported into 3dsmax (or maya, cinema4d, etc.) mantaining their animated status, so then I could render the animation in 3dsmax or any similar software.
So, does anybody know if there is a way to do that in processing?? Any help will be appreciated.
Hi, I'm trying to write a code to make convex polygon tesellations. I have just started, and I'm having problems regarding finding a point on a circumference (over its perimeter).
As the image shows, I have 4 points and 2 circumferences.
p1 is the center of circumference 1
p2 is the center of circumference 2
p3 is a point wich controls the radius of circumference 1 (therefore, it's contained in its perimeter)
p4 is the one giving me troubles; this point should control the circumference 2 radius (they are not linked yet, but it doesn't matter now). this point should be at an 120º angle with p3.
in order to do that, i calculated the gradient of the segment p1_p3. Having that, I used the atan() function to get its angle in radians (I assume it's the angle between that segment and an horizontal one). After that, I converted the angle from radians to degrees, and I used it to find the (x,y) coordinates over the circumference using trigonometric equations.
The problem is that p4, wich in the image is at 120º from p3, goes from that to 60º, depending on the value of the angle calculation based on the p1_p3 segment. And I would like it to be allways 120º... I'm sorry I can't be more specific, my english is not good, specially in math specialized terms.
Here is the code, highlighting the part regarding my issues.
// GLOBAL VARIABLES
float Radio1 = 300;
// Coordenadas Punto Móvil 1 (centro Circulo 1)
float NewPto1X = 0.0;
float NewPto1Y = 0.0;
//Coordenadas Punto Móvil 2 (centro Circulo 2)
//Coordenadas Punto Móvil 3 (Determina Radio Circulo 1)