{"id":203,"date":"2019-09-01T17:06:49","date_gmt":"2019-09-01T09:06:49","guid":{"rendered":"http:\/\/blog.coolcoding.cn\/?p=203"},"modified":"2020-09-27T17:04:44","modified_gmt":"2020-09-27T09:04:44","slug":"unity-%e8%87%aa%e8%a1%8c%e5%88%9b%e5%bb%bamesh%e6%97%a0%e6%b3%95%e6%ad%a3%e7%a1%ae%e6%8e%a5%e5%8f%97directionlight%e7%9a%84bug","status":"publish","type":"post","link":"https:\/\/blog.coolcoding.cn\/?p=203","title":{"rendered":"[Unity]\u81ea\u884c\u521b\u5efaMesh\u65e0\u6cd5\u6b63\u786e\u63a5\u53d7DirectionLight\u7684Bug"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>Unity\u521b\u5efaMesh:\n \nMesh mesh = new Mesh ();\nmf.mesh = mesh;\nmf.normals = new Vector3[]{ new Vector3(0,0,-1), Vector3(0,0,-1), Vector3(0,0,-1), new Vector3(0,0,-1)};\n \n\u8868\u73b0\u4e3a, \u4f7f\u7528\u6807\u51c6\u7684Unity Surface Lambert\u5149\u7167, \u65e0\u8bba\u600e\u4e48\u8c03\u8282Direction Light \u7684\u989c\u8272\/\u5f3a\u5ea6, \u5747\u4e0d\u53d7\u5f71\u54cd\n \n\u6700\u540e\u67e5\u51fa\u662fNormal\u9519\u8bef\u5bfc\u81f4,\u4fee\u6b63\u540e\u4e3a:\n \nnew Vector3[]{ new Vector3(0,1,0), new Vector3(0,1,0), new Vector3(0,1,0), new Vector3(0,1,0)};\n \n\u6216\u8005, \u628a mf.normals \u5220\u9664; \u4fee\u6b63\u4e3a:mesh.RecalculateNormals(); \u4e5f\u53ef<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[18],"_links":{"self":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/203"}],"collection":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=203"}],"version-history":[{"count":2,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/203\/revisions"}],"predecessor-version":[{"id":579,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/203\/revisions\/579"}],"wp:attachment":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=203"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=203"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=203"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}