the following example is using a pgraphics to reproduce the screen drawing in a larger resolution (sphere in the middle of the screen).
since I've updated to processing 2.0.2 my code behaves completely different. so maybe i'm doing something fundamentally wrong or there's a glitch in 2.0.2. can someone look into the following example and let me know if it's me or processing that's doing it wrong?
to reproduce:
1. start the sketch
2. hit any key to dump the pgraphics into a tif-file
3. expected result: screen: sphere in the center / file: sphere in the center
4. result: screen: sphere is totally offset / file: sphere in the center
i'm trying to figure out a way how to extract the global coordinates from a transformed point that i am about to draw. is there any way to do this that is non-destructive to the current stack of transformation?
...
rotateX(objectRotationX); // some object rotation
for (int i = 0; i <= 10; i++){
pushMatrix();
translate(i,0,0); rotateX(i/10); // or any other transforms that are changing through the loop
//need global coordinates of 'current' position here to add some analysis
point(0,0,0); // this would be the point in question
popMatrix();
}
// i need to be back in objectRotationX here
...
as far as i know, applyMatrix or resetMatrix would destroy the object's rotation. the reason for the question are multiple: it could for example be, that the z-depth or distance to a global camera have to be known...