Use this marker -> https://tetunori.github.io/p5.simpleAR/markers/1wFrame.png
A fork of p5.simpleAR Basic demo by tetunori
xxxxxxxxxx
const W = 240;
function setup() {
createARCanvas(W, W, P2D, { scale: 2, opacity: 0.7, markerId: 1 });
fill('red');
}
function draw() {
clear();
translate(W / 2, W / 2);
rotate(PI * sin(frameCount / 100));
translate(-W / 4, -W / 4);
square(0, 0, W / 2);
}