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 8131145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:59:43+00:00 2026-06-06T08:59:43+00:00

I have this object I’m loading with THREE.objLoader and then create a mesh with

  • 0

I have this object I’m loading with THREE.objLoader and then create a mesh with it like so:

mesh = new THREE.SceneUtils.createMultiMaterialObject(
  geometry,
  [
    new THREE.MeshBasicMaterial({color: 0xFEC1EA}),
    new THREE.MeshBasicMaterial({
      color: 0x999999,
      wireframe: true,
      transparent: true,
      opacity: 0.85
    })
  ]
);

In my scene I then add a DirectionalLight, it works and I can see my object, however it’s like the DirectionalLight was an ambient one. No face is getting darker or lighter as it should be.

The object is filled with the color, but no lighting is applied to it.
If someone can help me with that it would be much appreciated 🙂

What could I be missing ?

Jsfiddle here: http://jsfiddle.net/5hcDs/

  • 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-06T08:59:45+00:00Added an answer on June 6, 2026 at 8:59 am

    Ok folks, thanks to Maël Nison and mr doob I was able to understand the few things I was missing, being the total 3d noob that I am… I believe people starting to get into the 3d may find useful a little recap:

    Basic 3d concepts

    • A 3d Face is made of some points (Vertex), and a vector called a normal, indicating the direction of the face (which side is the front and which one is the backside).

    • Not having normals can be really bad, because lighting is applied on the frontside only by default. Hence the black model when trying to apply a LambertMaterial or PhongMaterial.

    • An OBJ file is a way to describe 3D information. Want more info on this? Read this wikipedia article (en). Also, the french page provides a cube example which can be useful for testing.

    Three.js tips and tricks

    • When normals are not present, the lighting can’t be applied, hence the black model render. Three.js can actually compute vertex and face normals with geometry.computeVertexNormals() and/or geometry.computeFaceNormals() depending on what’s missing

    • When you do so, there’s a chance Three.js’ normal calculation will be wrong and your normals will be flipped, to fix this you can simply loop through your geometry’s faces array like so:

    /* Compute normals */
    geometry.computeFaceNormals();
    geometry.computeVertexNormals();
    
    /* Next 3 lines seems not to be mandatory */
    mesh.geometry.dynamic = true
    mesh.geometry.__dirtyVertices = true;
    mesh.geometry.__dirtyNormals = true;
    
    mesh.flipSided = true;
    mesh.doubleSided = true;
    
    /* Flip normals*/               
    for(var i = 0; i<mesh.geometry.faces.length; i++) {
      mesh.geometry.faces[i].normal.x = -1*mesh.geometry.faces[i].normal.x;
      mesh.geometry.faces[i].normal.y = -1*mesh.geometry.faces[i].normal.y;
      mesh.geometry.faces[i].normal.z = -1*mesh.geometry.faces[i].normal.z;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this object below: I thought about putting the messages in html like
I have this object : IEnumerable<string> m_oEnum = null; and I'd like to initialize
I have this object: function formBuddy() { var fields = new Array(); var labels
I have this object, dive : var dive = new Foo.Bar(); And Foo.Bar looks
I have this object/array thing: var states = {}; states[CA] = new State(CA, California);
I have this object I need to create with JS and later on I
I have this object: stdClass Object ( [daily_inventoryID] => 1 [inventory_timestamp] => 2012-06-08 14:35:42
I have this object: class a { public string Application; public DateTime From, To;
I have this object which is an instance of a superclass. I want to
I have this line: @users = database['users'].find(:all).limit(10) it returns this object: <Mongo::Cursor:0x8759a858 namespace='app-development.users' @selector=:all

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.