Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8614563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:09:00+00:00 2026-06-12T05:09:00+00:00

I am creating a custom geometry by building custom located faces. I am using

  • 0

I am creating a custom geometry by building custom located faces. I am using the MeshNormalMaterial for material and I want to define the color for the faces independently one to each other. However, no matter what colors I set, I still get the same looking result.

My code below:

var geometry = new THREE.Geometry();
for (var i = 0; i < length - 1; i++) {
  for (var j = 0; j < length - 1; j++) {
    geometry.vertices.push(new THREE.Vector3(x[i][j], y[i][j], z[i][j]));
    geometry.vertices.push(new THREE.Vector3(x[i + 1][j], y[i + 1][j], z[i + 1][j]));
    geometry.vertices.push(new THREE.Vector3(x[i + 1][j + 1], y[i + 1][j + 1], z[i + 1][j + 1]));
    geometry.vertices.push(new THREE.Vector3(x[i][j + 1], y[i][j + 1], z[i][j + 1]));
    var face = new THREE.Face4(index, index + 1, index + 2, index + 3);
    face.color.setHex(color);
    geometry.faces.push(face);
    index += 4;
  }
}

geometry.computeFaceNormals();
var object = new THREE.Mesh(geometry, new MeshNormalMaterial());
parent.add(object);

What should I change to the above code such as I can set the face colors and have them actually display the colors I set?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T05:09:02+00:00Added an answer on June 12, 2026 at 5:09 am

    AFAIK MeshNormalMaterial will always give you the same colors.

    Try this:

    new MeshBasicMaterial({ vertexColors : THREE.VertexColors })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating custom UserControl in ASP.NET and I'm using System.ComponentModel.Attributes to decorate properties with
I'm creating custom forum software for a site I'm building, which includes 2 tables
I'm looking for a tutorial that explains creating custom usercontrols in WPF. I want
I am creating custom code snippet templates using DevExpress' CodeRush. Is there anyway for
I want to create a custom ribbon button within Outlook 2007 using Visual Studio
I am creating custom Swing components and want to provide a UI that looks
I'm stuck with creating custom adapter. I want to setOnClickListener on the buttons inside
I just started with creating custom objects in javascript. I want to set this.someObjVar
I am using vs2010 and I am creating custom tfs2010 build template. So I
We are using a 3rd party HR Tool (NuView) and are creating custom reports

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.