Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

136
Vistas
Isometric Room Generating X, Y Coloring

I want to generate an isometric room, and I want to color in this style: How I want

But my current code gives me this result: How it is actually

That's my current code (I don't know, if its the correct way to generate the blocks with this method. Maybee anyone can help me, how its work correctly?

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);
    }
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You change material style based only on value of iX variable. Instead, you should change it based on values of both iX and iZ variables like this:

if ((iX + iZ) % 2 === 0) {
  material = material1;
} else {
  material = material2;
}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda