{"id":2459,"date":"2024-11-10T09:25:06","date_gmt":"2024-11-10T01:25:06","guid":{"rendered":"https:\/\/fwq.ai\/blog\/2459\/"},"modified":"2024-11-10T09:25:06","modified_gmt":"2024-11-10T01:25:06","slug":"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8-echarts-gl-%e5%9c%a8-echarts-%e4%b8%ad%e5%88%9b%e5%bb%ba%e7%b1%bb%e4%bc%bc-3d-%e5%8f%91%e5%85%89%e6%95%88%e6%9e%9c%e7%9a%84%e5%9b%be%e8%a1%a8%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/2459\/","title":{"rendered":"\u5982\u4f55\u4f7f\u7528 Echarts-gl \u5728 Echarts \u4e2d\u521b\u5efa\u7c7b\u4f3c 3D \u53d1\u5149\u6548\u679c\u7684\u56fe\u8868\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173076985752097.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u4f7f\u7528 Echarts-gl \u5728 Echarts \u4e2d\u521b\u5efa\u7c7b\u4f3c 3D \u53d1\u5149\u6548\u679c\u7684\u56fe\u8868\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u4f7f\u7528 Echarts-gl \u5728 Echarts \u4e2d\u521b\u5efa\u7c7b\u4f3c 3D \u53d1\u5149\u6548\u679c\u7684\u56fe\u8868\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5728 echarts \u4e2d\u521b\u5efa\u7c7b\u4f3c 3d \u53d1\u5149\u56fe<\/strong><\/p>\n<p>echarts \u662f\u4e00\u4e2a\u6d41\u884c\u7684 JavaScript \u53ef\u89c6\u5316\u5e93\uff0c\u4f46\u5b83\u6ca1\u6709\u5185\u7f6e\u529f\u80fd\u6765\u521b\u5efa\u7c7b\u4f3c 3D \u53d1\u5149\u7684\u56fe\u8868\u3002\u4e0d\u8fc7\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528 echarts \u7684\u9ad8\u7ea7\u6e32\u67d3\u5f15\u64ce echarts-gl \u5e93\u6765\u5b9e\u73b0\u6b64\u6548\u679c\u3002<\/p>\n<p><strong>\u4f7f\u7528 echarts-gl<\/strong><\/p>\n<p>echarts-gl \u5e93\u63d0\u4f9b\u4e86\u7528\u4e8e\u521b\u5efa 3D \u56fe\u5f62\u7684 API\u3002\u4e3a\u4e86\u4f7f\u7528\u5b83\uff0c\u6211\u4eec\u9700\u8981\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a<\/p>\n<ol>\n<li>\u5b89\u88c5 echarts-gl \u5e93\uff1anpm install echarts-gl<\/li>\n<li>\u5f15\u5165 echarts-gl \u811a\u672c\u5230 HTML \u9875\u9762\uff1a <\/li>\n<li>\u521b\u5efa\u4e00\u4e2a ecgl \u5b9e\u4f8b\uff0c\u63d0\u4f9b DOM \u5143\u7d20\u4f5c\u4e3a\u56fe\u8868\u5bb9\u5668\uff1avar ecgl = echarts.init(dom, &#8216;gl&#8217;)<\/li>\n<\/ol>\n<p><strong>\u521b\u5efa\u53d1\u5149\u6548\u679c<\/strong><\/p>\n<p>\u4e3a\u4e86\u521b\u5efa\u53d1\u5149\u6548\u679c\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u9009\u9879\uff1a<\/p>\n<ul>\n<li> <strong>shading\uff1a&#8217;lambert&#8217;<\/strong>\uff1a\u542f\u7528Lambert\u7740\u8272\uff0c\u4f7f\u5149\u7ebf\u4ece\u8868\u9762\u53cd\u5c04\u3002<\/li>\n<li> <strong>light.intensity\uff1ax<\/strong>\uff1a\u589e\u52a0\u5149\u6e90\u5f3a\u5ea6\uff0c\u589e\u5f3a\u53d1\u5149\u6548\u679c\u3002<\/li>\n<li> <strong>ambient.intensity\uff1ax<\/strong>\uff1a\u589e\u52a0\u73af\u5883\u5149\u5f3a\u5ea6\uff0c\u63d0\u9ad8\u6574\u4f53\u4eae\u5ea6\u3002<\/li>\n<li> <strong>shininess\uff1ax<\/strong>\uff1a\u589e\u52a0\u5149\u6cfd\u5ea6\uff0c\u4f7f\u8868\u9762\u66f4\u80fd\u53cd\u5c04\u5149\u7ebf\u3002<\/li>\n<\/ul>\n<p>\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n<pre>option = {\n  shading: 'lambert',\n  light: {\n    intensity: 1.2\n  },\n  ambient: {\n    intensity: 0.5\n  },\n  shininess: 10\n};<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u8fd9\u6837\u5c31\u4f1a\u521b\u5efa\u4e00\u4e2a\u5177\u6709\u53d1\u5149\u6548\u679c\u7684 3D \u56fe\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u4f7f\u7528 Echarts-gl \u5728 Echarts \u4e2d\u521b\u5efa\u7c7b\u4f3c 3D \u53d1\u5149\u6548\u679c\u7684\u56fe\u8868\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u5728 echarts \u4e2d\u521b\u5efa\u7c7b\u4f3c 3d \u53d1\u5149\u56fe echarts \u662f\u4e00\u4e2a\u6d41\u884c\u7684 JavaScript \u53ef\u89c6\u5316\u5e93\uff0c\u4f46\u5b83\u6ca1\u6709\u5185\u7f6e\u529f\u80fd\u6765\u521b\u5efa\u7c7b\u4f3c 3D \u53d1\u5149\u7684\u56fe\u8868\u3002\u4e0d\u8fc7\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528 echarts \u7684\u9ad8\u7ea7\u6e32\u67d3\u5f15\u64ce echarts-gl \u5e93\u6765\u5b9e\u73b0\u6b64\u6548\u679c\u3002 \u4f7f\u7528 echarts-gl echarts-gl \u5e93\u63d0\u4f9b\u4e86\u7528\u4e8e\u521b\u5efa 3D \u56fe\u5f62\u7684 API\u3002\u4e3a\u4e86\u4f7f\u7528\u5b83\uff0c\u6211\u4eec\u9700\u8981\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a \u5b89\u88c5 echarts-gl \u5e93\uff1anpm install echarts-gl \u5f15\u5165 echarts-gl \u811a\u672c\u5230 HTML \u9875\u9762\uff1a \u521b\u5efa\u4e00\u4e2a ecgl \u5b9e\u4f8b\uff0c\u63d0\u4f9b DOM \u5143\u7d20\u4f5c\u4e3a\u56fe\u8868\u5bb9\u5668\uff1avar ecgl = echarts.init(dom, &#8216;gl&#8217;) \u521b\u5efa\u53d1\u5149\u6548\u679c \u4e3a\u4e86\u521b\u5efa\u53d1\u5149\u6548\u679c\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u9009\u9879\uff1a shading\uff1a&#8217;lambert&#8217;\uff1a\u542f\u7528Lambert\u7740\u8272\uff0c\u4f7f\u5149\u7ebf\u4ece\u8868\u9762\u53cd\u5c04\u3002 light.intensity\uff1ax\uff1a\u589e\u52a0\u5149\u6e90\u5f3a\u5ea6\uff0c\u589e\u5f3a\u53d1\u5149\u6548\u679c\u3002 ambient.intensity\uff1ax\uff1a\u589e\u52a0\u73af\u5883\u5149\u5f3a\u5ea6\uff0c\u63d0\u9ad8\u6574\u4f53\u4eae\u5ea6\u3002 shininess\uff1ax\uff1a\u589e\u52a0\u5149\u6cfd\u5ea6\uff0c\u4f7f\u8868\u9762\u66f4\u80fd\u53cd\u5c04\u5149\u7ebf\u3002 \u793a\u4f8b\u4ee3\u7801\uff1a option = { shading: &#8216;lambert&#8217;, light: { [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-2459","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/2459","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=2459"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/2459\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=2459"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=2459"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=2459"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}