The concept
Presence (or 'being there') is the psychological illusion of being physically in a virtual environment. It depends on latency (< 20ms), field of view, tracking quality, and sensory coherence. In XR design, presence is maximized through environment rendering, haptic feedback, and audiovisual coherence.
The code
// Presence: simulate latency effect on comfort
let lag = 0;
function setup() { createCanvas(400, 280); }
function draw() {
background(11, 15, 20);
// Lag slider
lag = map(mouseX, 0, width, 0, 25); // 0-25 frames lag
let lagged = int(lag);
// Crosshair (immediate)
stroke(255,100,100); strokeWeight(1);
line(mouseX-10,mouseY,mouseX+10,mouseY);
line(mouseX,mouseY-10,mouseX,mouseY+10);
// Virtual object (lagged)
noStroke(); fill(55, 227, 195, 200);
ellipse(mouseX - lagged*1.5, mouseY - lagged*1.5, 22, 22);
// Discomfort indicator
fill(lag>15 ? [255,100,80] : [55,227,195], 180);
text('Latence: '+nf(lag,1,0)+' frames', 20, 30);
text(lag>15 ? '⚠ inconfort' : '✓ confort', 20, 50);
}Going further
Explore other free courses on the Workshops page.
Practice, collaborate, deploy — in 15 min.
Book a discovery call →