I am working on creating an isometric room and I aim to color it in a specific style. However, the current code I have been using produces a different result than expected. Can anyone help me understand how this code works and potentially correct any mistakes?
for(let iX = 0; iX < 10; iX++) {
for(let iZ = 0; iZ < 10; iZ++) {
if(iX % 2 == 0) {
material = material1;
} else {
material = material2;
}
var box = generateBox(1, 0.1, 1, material);
box.name = `box-${iX}-${iZ}`;
box.position.set(iX, box.geometry.parameters.height / 2, iZ);
room.add(box);
}
}