Flip normals in three.js on sphere

前端 未结 4 1324
臣服心动
臣服心动 2021-01-05 16:02

I have been searching around and haven\'t found any really good answer to my question yet.. The thing is that I have this sphere.. just a basic sphere, and I want to flip th

4条回答
  •  醉酒成梦
    2021-01-05 16:49

    Another way is to simply flip the normals manually by making your object's geometry dynamic.

    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

提交回复
热议问题