3d: global coordinates
in
Programming Questions
•
1 month ago
hi forum.
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...
1