May you know the RGB 3D Cube from the Examples.. I want to rotate the cube with the values from my color sensor.
in that way if my sensor is black -> the black edge of the RGB Cube is poping in the front...If the sensor is blue-> the blue edge of the cube is int the fornt.
I try to transform the 3D Color Vecor to a 2D Vektor to rotate the cube
Well I try with that kind of code... but Iam stucking
// X= Red Y=green Z = Blue
// RGB Value Scale 0-1024
// I try to transform the 3D Color Vecor to a 2D Vektor to rotate the cube
v1 = new PVector(x,0,0);
v2 = new PVector(sin (30)*-y,sin (60)*y);
v3= new PVector(cos(60)*-z,sin(60)*-z);
v4 =new PVector(0,0,0);
cx= new PVector(0,0,0);
cy= new PVector(0,0,0);
v4.add(v1);
v4.add(v2);
v4.add(v3);
//Rotating Cube
pushMatrix();
translate(width/2+300, height/2, -30);
// Divide trough 1024 to scale down...
rotateX(((-v4.x)/2024)+1.2);
rotateY(((-v4.y)/1024)+2.2);
I have a color sensor that sends me its values over a PIC32 over RS 232 to processing.
Well, I have to transform the ADC measurements into the color space.