Processing for Android

Eye transformation

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


import processing.vr.*;

void setup() {
  fullScreen(STEREO);
}

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

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

One can retrieve the matrix holding this transformation:


import processing.vr.*;

PMatrix3D eyeMat = new PMatrix3D();

void setup() {
  fullScreen(STEREO);
}

void draw() {
  getEyeMatrix(eyeMat);  
}