Processing for Android

EN ES

Eye transformation

The eye transformation allows to use the coordinates relative to the viewer:


void setup() {
  fullScreen(P3D);
}

void draw() {
   // draw scene...

   pushMatrix();
   eye();
   translate(0, 0, 100);
   ellipse(0, 0, 50, 50);
   popMatrix();
}

One can retrieve the matrix holding this transformation:


PMatrix3D eyeMat = new PMatrix3D();

void setup() {
  fullScreen(P3D);
}

void draw() {
  // ...
  getEyeMatrix(eyeMat);
  // ...