let currCamera;
function
setup() {
createCanvas(500, 500, WEBGL);
helpText = createP(
"Move the sliders to change the "
+
"position of the camera"
);
helpText.position(20, 0);
currCamera = createCamera();
xPosSlider = createSlider(-360, 360, 0);
xPosSlider.position(20, 40);
yPosSlider = createSlider(-360, 360, 0);
yPosSlider.position(20, 70);
zPosSlider = createSlider(0, 800, 600);
zPosSlider.position(20, 100);
}
function
draw() {
clear();
lights();
normalMaterial();
debugMode();
let currX = xPosSlider.value();
let currY = yPosSlider.value();
let currZ = zPosSlider.value();
currCamera.setPosition(currX, currY, currZ);
cylinder(90);
}