After translating and rotating and attempting to use get(0,0) to find the color value of the point at the NEW origin, I am simply returned the value of the very top left pixel, regardless of these transformations and rotations. I believe this is due to the fact that get() references the pixel[] array? Anyways, is there any way to return the color value of a pixel relative to a translated and rotated matrix?
Hi,
you would probably hav to calculate the new position of that pixel. Translation ist just +/- in x/y direction and for the rotation use sin and cos.
Which renderer are you using? If you use P3D
it is possible to get the actual position by using modelX/Y/Z(..)
.
translate(15, 20);
rotate(radians(30));
translate(0, 10);
PVector pos = new PVector(modelX(0, 0, 0), modelY(0, 0, 0));
println("2D Position: " + pos);
will output:
2D Position: [ 10.0, 28.660248, 0.0 ]