{"id":20,"date":"2024-08-22T10:27:17","date_gmt":"2024-08-22T02:27:17","guid":{"rendered":"http:\/\/8.147.235.132:3838\/?p=20"},"modified":"2024-08-22T10:27:17","modified_gmt":"2024-08-22T02:27:17","slug":"php%e6%b8%b2%e6%9f%93%e4%b8%89%e7%bb%b4%e5%8a%a8%e7%94%bb","status":"publish","type":"post","link":"https:\/\/www.jpxiao.cn\/index.php\/2024\/08\/22\/php%e6%b8%b2%e6%9f%93%e4%b8%89%e7%bb%b4%e5%8a%a8%e7%94%bb\/","title":{"rendered":"php\u6e32\u67d3\u4e09\u7ef4\u52a8\u753b"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u4e09\u7ef4\u52a8\u753b\u6e32\u67d3<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7b80\u4ecb<br>&nbsp;&nbsp;&nbsp;&nbsp;\u672c\u63d2\u4ef6\u65e8\u5728\u4f7f\u7528 php \u5728\u63a7\u5236\u53f0\u751f\u6210\u4e09 3D \u52a8\u753b\uff0c\u672c\u63d2\u4ef6\u4ec5\u9002\u7528\u4e8e cli\uff08\u547d\u4ee4\u884c\uff09\u6a21\u5f0f\u3002\u672c\u9879\u76ee\u5df2\u63d0\u4f9b\u4e86\u7acb\u65b9\u4f53\u548c\u91d1\u5b57\u5854\u6a21\u578b\u7684\u52a8\u753b\u53c2\u6570\uff0c<br>\u4f60\u53ef\u4ee5\u4f7f\u7528 demo \u8fdb\u884c\u6d4b\u8bd5\u3002\u672c\u63d2\u4ef6\u5de5\u4f5c\u539f\u7406\uff1a\u7c7b\u4f3c\u4e8e\u73b0\u5728\u7684\u6fc0\u5149\u626b\u63cf\uff0c\u83b7\u53d6\u4e09\u7ef4\u5b9e\u7269\u7684\u5916\u90e8\u8f6e\u5ed3\u7684\u9876\u70b9\uff0c\u7136\u540e\u8fde\u63a5\u8fd9\u4e9b\u9876\u70b9\uff0c\u5c31\u53ef\u4ee5\u6784\u6210\u4e09\u7ef4\u4e8b\u52a1\u7684\u6a21\u578b\u3002\u5728\u4f7f\u7528\u672c<br>\u63d2\u4ef6\u7684\u65f6\u5019\uff0c\u4f60\u53ea\u9700\u8981\u8f93\u5165\u4e09\u7ef4\u4e8b\u7269\u8f6e\u5ed3\u7684\u9876\u70b9\u5750\u6807\uff0c\u7136\u540e\u63d0\u4f9b\u8fd9\u4e9b\u9876\u70b9\u5750\u6807\u7684\u8fde\u63a5\u8def\u7ebf\uff08\u4e24\u70b9\u786e\u5b9a\u4e00\u6761\u76f4\u7ebf\uff09, \u63d2\u4ef6\u5c31\u53ef\u4ee5\u7ed8\u5236\u51fa\u5bf9\u5e94\u7684\u4e09\u7ef4\u6a21\u578b\u3002\u5982\u679c\u4f60\u63d0\u4f9b\u4e86<br>\u4e8b\u52a1\u5728\u4e09\u7ef4\u5750\u6807\u4e2d\u7684\u65cb\u8f6c\u89d2\u901f\u5ea6\uff0c\u90a3\u4e48\u672c\u63d2\u4ef6\u53ef\u4ee5\u5b9e\u73b0\u6a21\u578b\u7684\u65cb\u8f6c\u529f\u80fd\u3002\u5982\u679c\u4f60\u63d0\u4f9b\u4e86\u4e09\u7ef4\u4e8b\u52a1\u5728 x \u8f74\u548c y \u8f74\u4e0a\u7684\u504f\u79fb\u65b9\u5411\u548c\u901f\u5ea6\uff0c\u90a3\u4e48\u672c\u63d2\u4ef6\u751f\u6210\u7684\u52a8\u753b\u4e2d\uff0c\u6a21\u578b\u53ef\u4ee5<br>\u5b9e\u73b0\u4e0a\u4e0b\u5de6\u53f3\u79fb\u52a8\u3002\u5982\u679c\u4f60\u63d0\u4f9b\u4e86\u4e0d\u540c\u65f6\u523b\u7684\u6a21\u578b\u7684\u9876\u70b9\u7684\u5750\u6807\uff0c\u53ef\u4ee5\u5b9e\u73b0\u6a21\u578b\u5f62\u72b6\u7684\u5207\u6362\u3002\u672c\u63d2\u4ef6\u7684\u7528\u9014\u6682\u65f6\u672a\u77e5\uff0c\u56e0\u4e3a\u6ca1\u4eba\u4f1a\u7528 php \u7684 cli \u6a21\u5f0f\u6765\u505a\u52a8\u753b\u3002\u4f46\u662f\u53ef\u4ee5<br>\u63a5\u5165\u7528\u6237\u8f93\u5165\u548c\u7f51\u7edc\u6570\u636e\u4ea4\u4e92\uff0c\u4ece\u800c\u5b9e\u73b0\u7c7b\u4f3c\u4e8e\u4ee5\u524d\u7684\u7f51\u7edc\u52a8\u6f2b\u6e38\u620f\u3002 \u6240\u4ee5\uff0c\u4ec5\u4ec5\u5f53\u505a\u5c0f\u73a9\u5177\u5427\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b89\u88c5<br>composer require xiaosongshu\/animation<br>\u4f7f\u7528\u793a\u4f8b<br>\u65cb\u8f6c\u7684\u7acb\u65b9\u4f53<br>&lt;?php<br>require_once <strong>DIR<\/strong>.&#8217;\/vendor\/autoload.php&#8217;;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">$client = new \\Xiaosongshu\\Animation\\Client();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\/** \u7acb\u65b9\u4f53 <em>\/ $config2 = [ \/<\/em>* \u521d\u59cb\u4e09\u7ef4\u503e\u659c\u5ea6 <em>\/ &#8216;angleX&#8217; =&gt; 0, &#8216;angleY&#8217; =&gt; 0, &#8216;angleZ&#8217; =&gt; 0, \/<\/em>* \u4e09\u7ef4\u89d2\u901f\u5ea6 <em>\/ &#8216;angleStepX&#8217; =&gt; 0.01, &#8216;angleStepY&#8217; =&gt; 0.01, &#8216;angleStepZ&#8217; =&gt; 0.01, \/<\/em>* \u7f29\u653e\u6bd4\u4f8b <em>\/ &#8216;scale&#8217; =&gt; 0, \/<\/em>* \u521d\u59cb\u4e8c\u7ef4\u504f\u79fb\u91cf <em>\/ &#8216;distanceX&#8217; =&gt; 0, &#8216;distanceY&#8217; =&gt; 0, \/<\/em>* \u4e8c\u7ef4\u56fe\u50cf\u504f\u79fb\u6b65\u957f <em>\/ &#8216;distanceXStep&#8217; =&gt; 1, &#8216;distanceYStep&#8217; =&gt; 1, \/<\/em>* \u4e8c\u7ef4x\u8f74\u6b63\u65b9\u5411\u504f\u79fb <em>\/ &#8216;directionX&#8217; =&gt; -1, \/<\/em>* \u4e8c\u7ef4y\u8f74\u6b63\u65b9\u5411\u504f\u79fb <em>\/ &#8216;directionY&#8217; =&gt; -1, \/<\/em>* \u4e09\u7ef4\u56fe\u6848\u9876\u70b9\u5750\u6807 : \u66f4\u65b0\u4e09\u7ef4\u7269\u4f53\u7684\u9876\u70b9\u5750\u6807\uff0c\u53ef\u4ee5\u5b9e\u73b0\u6a21\u578b\u7684\u5f62\u72b6\u6539\u53d8 <em>\/ &#8216;vertices&#8217; =&gt; [ \/<\/em>* \u7b2c\u4e00\u4e2a\u52a8\u4f5c <em>\/ [ [-1, -1, -1], [1, -1, -1], [1, 1, -1], [-1, 1, -1], [-1, -1, 1], [1, -1, 1], [1, 1, 1], [-1, 1, 1] ], \/\/ \u2026 \u5176\u4ed6\u52a8\u4f5c ], \/<\/em>* \u4e09\u7ef4\u56fe\u6848\u7ed8\u56fe\u8def\u5f84 *\/<br>&#8216;edges&#8217; =&gt; [[0, 1], [1, 2], [2, 3], [3, 0], [4, 5], [5, 6], [6, 7], [7, 4], [0, 4], [1, 5], [2, 6], [3, 7]],<br>];<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">$client-&gt;add3dAnimation($config2);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\/** \u6d41\u661f <em>\/ $config3 = [ &#8216;maxStars&#8217; =&gt; 10, &#8216;numStars&#8217; =&gt; 10, &#8216;isWaterLine&#8217; =&gt; true, \/<\/em>* \u521d\u59cb\u4e8c\u7ef4\u504f\u79fb\u91cf <em>\/ &#8216;distanceX&#8217; =&gt; 0, &#8216;distanceY&#8217; =&gt; 0, \/<\/em>* \u4e8c\u7ef4\u56fe\u50cf\u504f\u79fb\u6b65\u957f <em>\/ &#8216;distanceXStep&#8217; =&gt; 2, &#8216;distanceYStep&#8217; =&gt; 1, \/<\/em>* \u4e8c\u7ef4x\u8f74\u6b63\u65b9\u5411\u504f\u79fb <em>\/ &#8216;directionX&#8217; =&gt; 0, \/<\/em>* \u4e8c\u7ef4y\u8f74\u6b63\u65b9\u5411\u504f\u79fb *\/<br>&#8216;directionY&#8217; =&gt; 0,<br>];<br>$client-&gt;addStarRain($config3);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">$client-&gt;run();<br>\u8fd0\u884c<br>php yourPath\/demo.php<br>\u6548\u679c\u56fe<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/learnku.com\/topics\/88033\/patches\/create\" target=\"_blank\" rel=\"noreferrer noopener\"><\/a><a href=\"javascript:void(0)\"><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e09\u7ef4\u52a8\u753b\u6e32\u67d3 \u7b80\u4ecb&nbsp;&nbsp;&nbsp;&nbsp;\u672c\u63d2\u4ef6\u65e8\u5728\u4f7f\u7528 php \u5728\u63a7\u5236\u53f0\u751f\u6210\u4e09 3D [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-20","post","type-post","status-publish","format-standard","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/www.jpxiao.cn\/index.php\/wp-json\/wp\/v2\/posts\/20","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jpxiao.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jpxiao.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jpxiao.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jpxiao.cn\/index.php\/wp-json\/wp\/v2\/comments?post=20"}],"version-history":[{"count":1,"href":"https:\/\/www.jpxiao.cn\/index.php\/wp-json\/wp\/v2\/posts\/20\/revisions"}],"predecessor-version":[{"id":21,"href":"https:\/\/www.jpxiao.cn\/index.php\/wp-json\/wp\/v2\/posts\/20\/revisions\/21"}],"wp:attachment":[{"href":"https:\/\/www.jpxiao.cn\/index.php\/wp-json\/wp\/v2\/media?parent=20"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jpxiao.cn\/index.php\/wp-json\/wp\/v2\/categories?post=20"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jpxiao.cn\/index.php\/wp-json\/wp\/v2\/tags?post=20"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}