Calculating normals between 2 meshes ending up in seams

后端 未结 1 396
予麋鹿
予麋鹿 2021-01-02 00:44

My Task

I currently creating a terrain for Unity3D which is specialized for mobile-devices with low memory for a running app. Allowing a terrain with a size of 15.

相关标签:
1条回答
  • 2021-01-02 01:27

    I still don't know why it happens but when replacing this....

    Vector3 u = vertices[item.Face1] - vertices[item.Face0];
    Vector3 v = vertices[item.Face2] - vertices[item.Face0];
    
    Vector3 fn = new Vector3((u.Y * v.Z) - (u.Z * v.Y), (u.Z * v.X) - (u.X * v.Z), (u.X * v.Y) - (u.Y * v.X));
    fn.Normalize();
    normal += fn;
    

    with another AddFaceNormal-method it works. I don't know why this happend but now it works.

    0 讨论(0)
提交回复
热议问题