Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

140
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!