Static p5_sys::global::orbitControl[][src]

pub static orbitControl: OrbitControlInternalType
Expand description

Allows movement around a 3D sketch using a mouse or trackpad. Left-clicking and dragging will rotate the camera position about the center of the sketch, right-clicking and dragging will pan the camera position without rotation, and using the mouse wheel (scrolling) will move the camera closer or further from the center of the sketch. This function can be called with parameters dictating sensitivity to mouse movement along the X and Y axes. Calling this function without parameters is equivalent to calling orbitControl(1,1). To reverse direction of movement in either axis, enter a negative number for sensitivity.

Examples

function setup() {
  createCanvas(100, 100, WEBGL);
  normalMaterial();
}
function draw() {
  background(200);
  orbitControl();
  rotateY(0.5);
  box(30, 50);
}

Parameters

sensitivityX? sensitivity to mouse movement along X axis

sensitivityY? sensitivity to mouse movement along Y axis

sensitivityZ? sensitivity to scroll movement along Z axis