Three.js: How to flip normals after negative scale

前端 未结 5 1335
臣服心动
臣服心动 2020-12-06 13:50

I have cloned and than flipped an object using negative scale, which causes my single sided faces to inverse. My question is, how can i flip the normals too?

I don\'

5条回答
  •  爱一瞬间的悲伤
    2020-12-06 14:49

    This question is two years old, but in case anyone passes by. Here is a non-destructive way of doing this:

    You can enter the "dirty vertices/normals" mode, and flip the normals manually:

    mesh.geometry.dynamic = true
    mesh.geometry.__dirtyVertices = true;
    mesh.geometry.__dirtyNormals = true;
    
    mesh.flipSided = true;
    
    //flip every vertex normal in mesh by multiplying normal by -1
    for(var i = 0; i

    +1 @WestLangley, I suggest you never use negative scale.

提交回复
热议问题