I need some help with UV mapping an octahedron. Here’s my code :
let w = 0;
let h = 0;
let th = 400;
beginShape();
vertex(w - side, h - side, 0, 0, 1);
vertex(w + side, h - side, 0, 0, 0);
vertex(w, h, th, 0.5, 1);
vertex(w + side, h - side, 0, 0, 1);
vertex(w + side, h + side, 0, 0.5, 0);
vertex(w, h, th, 0.5, 1);
vertex(w + side, h + side, 0, 0, 1);
vertex(w - side, h + side, 0, 0, 0);
vertex(w, h, th, 0.5, 1);
vertex(w - side, h - side, 0, 0, 1);
vertex(w - side, h + side, 0, 0, 0);
vertex(w, h, th, 0.5, 1);
vertex(w - side, h - side, 0, 0 , 1);
vertex(w + side, h - side, 0, 0, 0);
vertex(w, h, -th, 0.5, 0);
vertex(w + side, h - side, 0, 0, 1);
vertex(w + side, h + side, 0, 0, 0);
vertex(w, h, -th, 0.5, 0);
vertex(w + side, h + side, 0, 0, 1);
vertex(w - side, h + side, 0, 0, 0);
vertex(w, h, -th, 0.5, 0);
vertex(w - side, h - side, 0, 0, 1);
vertex(w - side, h + side, 0, 0, 0);
vertex(w, h, -th, 0.5, 0);
endShape(CLOSE);