[Go to site: main page, start]

Processing for Android

EN ES

VRCamera

The VRCamera object provides some utility functions to facilitate setting the view in VR.

  • sticky()

    It sets the coordinates to the eye system, so it is easier to draw elements that are static with respect to the head movement.

  • noSticky()

    It returns the coordinats to the default world system, removing any transformartions that might have been applied in eye space.

  • setPosition(float x, float y, float z)

    Sets the camera position to the point (x, y, z).

  • setNear(float near)

    Sets the Z distance to the near plane.

  • setFar(float far)

    Sets the Z distance to the far plane.


import processing.vr.*;

VRCamera cam;

void setup() {
  fullScreen(VR);
  cameraUp();
}

void draw() {
  background(200, 0, 150);
  cam.setPosition(0, 0, 400);
  //...
  cam.sticky();
  translate(0, 0, 200);
  circle(0, 0, 50);
  cam.noSticky();
}