xxxxxxxxxx
34
function setup() {
pixelDensity(1);
createCanvas(800, 800)
background(0)
loadPixels()
// start position
let line_length = 150 // also scale
let offx = (height / 2 - line_length / 2) * width * 4 + (width / 2 - line_length * 5 / 2) * 4
for (let i = 0; i < line_length; i += 1) {
for (let k = 0; k < 3; k += 1) { // just to handle all color components
let c = 255 // color
// O
pixels[offx + (i * width) * 4 + k] = c
pixels[offx + (line_length + i * width) * 4 + k] = c
pixels[offx + i * 4 + k] = c
pixels[offx + (i + line_length * width) * 4 + k] = c
// R
pixels[offx + (line_length*2+i * width) * 4 + k] = c
pixels[offx + (line_length*2+i) * 4 + k] = c
// Z
pixels[offx + (i + line_length*4) * 4 + k] = c
pixels[offx + (i + line_length*4 + (line_length - i) * width) * 4 + k] = c
pixels[offx + (i + line_length*4 + line_length * width) * 4 + k] = c
}
}
updatePixels()
}
function draw() {
}