fractalkitty looking for math? fractalkitty.com

codepen challenges

ringSphere

#trig#3d#interactive#animation#math#codepen-challenge

function setup() {
	createCanvas(windowWidth, windowHeight, WEBGL);
	specularMaterial(255);
	noStroke();
	angleMode(DEGREES);
}
function draw() {
	background(0);
	orbitControl();
	t = frameCount;
	rotateX(t);
	rotateY(t);
	pointLight(95, 95, 95, 500, 500, 1500);
	torus(min(width / 4, height / 4), 10, 50, 24);
	push();
	translate(0, 0, 500 * sin(t) * cos(t));
	sphere(min(width / 8, height / 8), 24, 24);
	pop();
}