{"id":54639,"date":"2025-08-13T09:19:51","date_gmt":"2025-08-13T01:19:51","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/54639.html"},"modified":"2025-08-13T09:19:51","modified_gmt":"2025-08-13T01:19:51","slug":"%e5%89%8d%e7%ab%af%e5%b0%8f%e7%bb%83%e4%b9%a0-%e9%9c%93%e8%99%b9%e5%bc%b9%e5%b9%95%e9%9b%a8-js-%e8%83%bd%e5%9c%a8%e6%b5%8f%e8%a7%88%e5%99%a8%e9%87%8c%e6%94%be%e7%83%9f%e8%8a%b1","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/54639.html","title":{"rendered":"\u524d\u7aef\u5c0f\u7ec3\u4e60 \u2014\u2014 \u9713\u8679\u5f39\u5e55\u96e8 (JS \u80fd\u5728\u6d4f\u89c8\u5668\u91cc\u653e\u70df\u82b1\uff01)"},"content":{"rendered":"<h2 id=\"\" style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813011948-689be834a0753.png\" \/><\/h2>\n<p>\u524d\u8a00&#xff1a;\u521d\u5b66 JS \u65f6&#xff0c;\u4f60\u53ef\u80fd\u89c9\u5f97\u5b83\u5c31\u662f\u4e2a \u201c\u8868\u5355\u9a8c\u8bc1\u5de5\u5177\u4eba\u201d\u2014\u2014 \u6700\u591a\u5f39\u4e2a alert \u6846\u6846\u3002\u4f46\u4eca\u5929\u8fd9\u4e2a\u6848\u4f8b\u4f1a\u8ba9\u4f60\u77aa\u5927\u773c\u775b&#xff1a;\u8fd9\u73a9\u610f\u513f\u5c45\u7136\u80fd\u5728\u6d4f\u89c8\u5668\u91cc\u641e\u51fa \u201c\u8d5b\u535a\u670b\u514b\u70df\u82b1\u79c0\u201d&#xff1f;\u522b\u7728\u773c&#xff0c;\u54b1\u4eec\u8fd9\u5c31\u5f00\u6574&#xff01; \u60f3\u6284\u4f5c\u4e1a&#xff1f;\u76f4\u63a5\u62c9\u5230\u6700\u540e&#xff0c;\u5b8c\u6574\u4ee3\u7801\u7ed9\u4f60\u5907\u597d&#xff0c;\u590d\u5236\u7c98\u8d34\u5c31\u80fd\u770b\u6548\u679c&#xff01;<\/p>\n<p>\u5148\u4e0a\u6548\u679c\u56fe\u63cf\u8ff0&#xff1a;\u60f3\u8c61\u4e00\u4e0b \u2014\u2014 \u6f06\u9ed1\u7684\u80cc\u666f\u91cc&#xff0c;\u6210\u5343\u4e0a\u4e07\u7684\u5f69\u8272\u7c92\u5b50\u50cf\u88ab\u6309\u4e0b\u64ad\u653e\u952e\u7684\u5f39\u5e55&#xff0c;\u6709\u7684\u76f4\u7ebf\u72c2\u98d9&#xff0c;\u6709\u7684\u87ba\u65cb\u7ed5\u5708&#xff0c;\u8fd1\u5904\u7684\u7c92\u5b50\u4eae\u5f97\u6643\u773c&#xff0c;\u8fdc\u5904\u7684\u62d6\u7740\u6de1\u6de1\u7684\u9713\u8679\u5c3e\u5df4&#xff0c;\u9f20\u6807\u4e00\u62d6\u8fd8\u80fd 360\u00b0 \u8f6c\u7740\u770b\u3002\u5c31\u50cf\u628a\u79d1\u5e7b\u7535\u5f71\u91cc\u7684\u98de\u8239\u5c3e\u6c14\u642c\u8fdb\u4e86\u6d4f\u89c8\u5668&#xff0c;\u5173\u952e\u662f&#xff1a;\u8fd9\u5c45\u7136\u662f JS \u5199\u7684&#xff01;<\/p>\n<p>\u5728\u5f00\u59cb\u4e4b\u524d&#xff0c;\u5148\u5f97\u77e5\u9053\u54b1\u4eec\u8981 \u201c\u53ec\u5524\u201d \u8fd9\u4e9b\u7c92\u5b50\u9700\u8981\u5565 \u201c\u5492\u8bed\u201d&#xff1a;<\/p>\n<ul>\n<li>Three.js&#xff1a;3D \u4e16\u754c\u7684 \u201c\u5305\u5de5\u5934\u201d&#xff0c;\u4e0d\u7528\u81ea\u5df1\u642c\u7816&#xff08;\u5199\u5e95\u5c42 3D \u903b\u8f91&#xff09;&#xff0c;\u5b83\u5e2e\u4f60\u628a WebGL \u5305\u88c5\u5f97\u660e\u660e\u767d\u767d\u3002<\/li>\n<li>WebGL&#xff1a;Three.js \u80cc\u540e\u7684 \u201c\u5e95\u5c42\u642c\u7816\u5de5\u201d&#xff0c;\u8d1f\u8d23\u5728\u7f51\u9875\u4e0a\u753b 3D \u56fe\u5f62&#xff0c;\u54b1\u4eec\u4e0d\u7528\u76f4\u63a5\u6307\u6325\u5b83&#xff0c;\u4f46\u5f97\u77e5\u9053\u6709\u8fd9\u4e48\u4e2a\u72e0\u89d2\u8272\u3002<\/li>\n<li>\u7740\u8272\u5668&#xff1a;\u7c92\u5b50\u7684 \u201c\u9020\u578b\u5e08\u201d&#xff0c;\u63a7\u5236\u6bcf\u4e2a\u70b9\u7684\u5927\u5c0f\u3001\u989c\u8272\u3001\u8fd0\u52a8\u59ff\u52bf&#xff0c;\u8ba9\u5b83\u4eec\u522b\u957f\u5f97\u5343\u7bc7\u4e00\u5f8b\u3002<\/li>\n<li>\u52a8\u753b\u5faa\u73af&#xff1a;\u5c31\u50cf\u7ed9\u7c92\u5b50\u4e0a\u4e86 \u201c\u6c38\u52a8\u673a\u201d&#xff0c;\u8ba9\u5b83\u4eec\u4e00\u76f4\u52a8\u8d77\u6765&#xff0c;\u4e0d\u4f1a\u5361\u6210 PPT\u3002<\/li>\n<li>\u54cd\u5e94\u5f0f&#xff1a;\u7a97\u53e3\u653e\u5927\u7f29\u5c0f&#xff1f;\u7c92\u5b50\u4eec\u4f1a\u81ea\u52a8\u8c03\u6574\u961f\u5f62&#xff0c;\u4e0d\u4f1a\u4e71\u6210\u4e00\u9505\u7ca5\u3002<\/li>\n<\/ul>\n<h3 id=\"%E7%9B%AE%E5%BD%95\">\u76ee\u5f55<\/h3>\n<p id=\"1.%20%E5%8F%AC%E5%94%A4%20%E2%80%9C%E5%B7%A5%E5%85%B7%E4%BA%BA%E2%80%9D%20%E5%BA%93-toc\" style=\"margin-left:80px\">1. \u53ec\u5524 \u201c\u5de5\u5177\u4eba\u201d \u5e93<\/p>\n<p id=\"2.%20%E6%90%AD%E4%B8%AA%20%E2%80%9C%E8%88%9E%E5%8F%B0%E2%80%9D%EF%BC%88%E5%9C%BA%E6%99%AF%E5%92%8C%E7%9B%B8%E6%9C%BA%EF%BC%89-toc\" style=\"margin-left:80px\">2. \u642d\u4e2a \u201c\u821e\u53f0\u201d&#xff08;\u573a\u666f\u548c\u76f8\u673a&#xff09;<\/p>\n<p id=\"3.%20%E8%AF%B7%20%E2%80%9C%E6%91%84%E5%BD%B1%E5%B8%88%E2%80%9D%EF%BC%88%E6%B8%B2%E6%9F%93%E5%99%A8%EF%BC%89-toc\" style=\"margin-left:80px\">3. \u8bf7 \u201c\u6444\u5f71\u5e08\u201d&#xff08;\u6e32\u67d3\u5668&#xff09;<\/p>\n<p id=\"4.%20%E8%AE%A9%E8%88%9E%E5%8F%B0%20%E2%80%9C%E4%BC%B8%E7%BC%A9%E8%87%AA%E5%A6%82%E2%80%9D%EF%BC%88%E7%AA%97%E5%8F%A3%E9%80%82%E9%85%8D%EF%BC%89-toc\" style=\"margin-left:80px\">4. \u8ba9\u821e\u53f0 \u201c\u4f38\u7f29\u81ea\u5982\u201d&#xff08;\u7a97\u53e3\u9002\u914d&#xff09;<\/p>\n<p id=\"5.%20%E7%BB%99%E8%A7%82%E4%BC%97%20%E2%80%9C%E6%93%8D%E6%8E%A7%E6%9D%83%E2%80%9D%EF%BC%88%E6%8E%A7%E5%88%B6%E5%99%A8%EF%BC%89-toc\" style=\"margin-left:80px\">5. \u7ed9\u89c2\u4f17 \u201c\u64cd\u63a7\u6743\u201d&#xff08;\u63a7\u5236\u5668&#xff09;<\/p>\n<p id=\"6.%20%E7%BB%99%E7%B2%92%E5%AD%90%20%E2%80%9C%E7%BC%96%E5%BA%8F%E5%8F%B7%E2%80%9D%EF%BC%88%E5%85%A8%E5%B1%80%E5%8F%98%E9%87%8F%EF%BC%89-toc\" style=\"margin-left:80px\">6. \u7ed9\u7c92\u5b50 \u201c\u7f16\u5e8f\u53f7\u201d&#xff08;\u5168\u5c40\u53d8\u91cf&#xff09;<\/p>\n<p id=\"7.%20%E7%94%9F%E6%88%90%E7%AC%AC%E4%B8%80%E6%89%B9%20%E2%80%9C%E6%BC%94%E5%91%98%E2%80%9D%EF%BC%88%E7%B2%92%E5%AD%90%E6%95%B0%E7%BB%84%EF%BC%89-toc\" style=\"margin-left:80px\">7. \u751f\u6210\u7b2c\u4e00\u6279 \u201c\u6f14\u5458\u201d&#xff08;\u7c92\u5b50\u6570\u7ec4&#xff09;<\/p>\n<p id=\"8.%20%E5%8A%A0%E6%9B%B4%E5%A4%9A%20%E2%80%9C%E7%BE%A4%E6%BC%94%E2%80%9D%EF%BC%88%E8%A1%A5%E5%85%85%E7%B2%92%E5%AD%90%EF%BC%89-toc\" style=\"margin-left:80px\">8. \u52a0\u66f4\u591a \u201c\u7fa4\u6f14\u201d&#xff08;\u8865\u5145\u7c92\u5b50&#xff09;<\/p>\n<p id=\"9.%20%E7%BB%99%E7%B2%92%E5%AD%90%20%E2%80%9C%E7%A9%BF%E8%A1%A3%E6%9C%8D%E2%80%9D%EF%BC%88%E5%87%A0%E4%BD%95%E4%BD%93%E5%92%8C%E6%9D%90%E8%B4%A8%EF%BC%89-toc\" style=\"margin-left:80px\">9. \u7ed9\u7c92\u5b50 \u201c\u7a7f\u8863\u670d\u201d&#xff08;\u51e0\u4f55\u4f53\u548c\u6750\u8d28&#xff09;<\/p>\n<p id=\"10.%20%E8%AE%A9%E6%BC%94%E5%91%98%20%E2%80%9C%E4%B8%8A%E5%8F%B0%E2%80%9D%EF%BC%88%E7%82%B9%E4%BA%91%E8%BF%9B%E5%9C%BA%E6%99%AF%EF%BC%89-toc\" style=\"margin-left:80px\">10. \u8ba9\u6f14\u5458 \u201c\u4e0a\u53f0\u201d&#xff08;\u70b9\u4e91\u8fdb\u573a\u666f&#xff09;<\/p>\n<p id=\"11.%20%E5%BC%80%E5%A7%8B%20%E2%80%9C%E8%A1%A8%E6%BC%94%E2%80%9D%EF%BC%88%E6%B8%B2%E6%9F%93%E5%BE%AA%E7%8E%AF%EF%BC%89-toc\" style=\"margin-left:80px\">11. \u5f00\u59cb \u201c\u8868\u6f14\u201d&#xff08;\u6e32\u67d3\u5faa\u73af&#xff09;<\/p>\n<hr id=\"hr-toc\" \/>\n<h4 id=\"1.%20%E5%8F%AC%E5%94%A4%20%E2%80%9C%E5%B7%A5%E5%85%B7%E4%BA%BA%E2%80%9D%20%E5%BA%93\">1. \u53ec\u5524 \u201c\u5de5\u5177\u4eba\u201d \u5e93<\/h4>\n<p>\u8981\u641e\u4e8b\u60c5&#xff0c;\u5148\u628a\u5bb6\u4f19\u4e8b\u513f\u5907\u9f50&#xff1a;<\/p>\n<p>import * as THREE from &#034;https:\/\/cdn.skypack.dev\/three&#064;0.136.0&#034;; \/\/ 3D\u5305\u5de5\u5934<br \/>\nimport { OrbitControls } from &#034;https:\/\/cdn.skypack.dev\/three&#064;0.136.0\/examples\/jsm\/controls\/OrbitControls&#034;; \/\/ \u89c2\u4f17\u64cd\u63a7\u5668<br \/>\nconsole.clear(); \/\/ \u6e05\u6389\u63a7\u5236\u53f0\u7684\u5783\u573e&#xff0c;\u514d\u5f97\u5f71\u54cd\u88c5X  <\/p>\n<p>\u5410\u69fd&#xff1a;\u5c31\u50cf\u505a\u996d\u524d\u5148\u628a\u9505\u7897\u74e2\u76c6\u6446\u51fa\u6765&#xff0c;\u8fd9\u91cc\u5148\u628a Three.js \u548c\u63a7\u5236\u5668 \u201c\u8bf7\u201d \u8fdb\u6765&#xff0c;\u987a\u4fbf\u628a\u63a7\u5236\u53f0\u64e6\u5e72\u51c0 \u2014\u2014 \u4e4b\u524d\u8c03\u8bd5\u7684console.log\u5c31\u50cf\u53a8\u623f\u5783\u573e&#xff0c;\u5f97\u6e05\u6389\u3002<\/p>\n<h4 id=\"2.%20%E6%90%AD%E4%B8%AA%20%E2%80%9C%E8%88%9E%E5%8F%B0%E2%80%9D%EF%BC%88%E5%9C%BA%E6%99%AF%E5%92%8C%E7%9B%B8%E6%9C%BA%EF%BC%89\">2. \u642d\u4e2a \u201c\u821e\u53f0\u201d&#xff08;\u573a\u666f\u548c\u76f8\u673a&#xff09;<\/h4>\n<p>\u6ca1\u6709\u821e\u53f0&#xff0c;\u7c92\u5b50\u4eec\u5728\u54ea\u513f\u8868\u6f14&#xff1f;<\/p>\n<p>let scene &#061; new THREE.Scene(); \/\/ \u5efa\u4e2a\u821e\u53f0<br \/>\nscene.background &#061; new THREE.Color(0x000000); \/\/ \u821e\u53f0\u80cc\u666f&#xff1a;\u7eaf\u9ed1&#xff0c;\u50cf\u7535\u5f71\u9662\u5173\u706f<br \/>\nlet camera &#061; new THREE.PerspectiveCamera(75, innerWidth \/ innerHeight, 0.1, 1000); \/\/ \u67b6\u4e2a\u76f8\u673a<br \/>\ncamera.position.set(0, 5, 30); \/\/ \u76f8\u673a\u4f4d\u7f6e&#xff1a;\u7ad9\u5728\u540e\u6392\u770b\u821e\u53f0&#xff0c;\u4e0d\u8fdc\u4e0d\u8fd1  <\/p>\n<p>\u5410\u69fd&#xff1a;\u80cc\u666f\u8bbe\u6210\u7eaf\u9ed1&#xff0c;\u624d\u80fd\u51f8\u663e\u7c92\u5b50\u7684\u9713\u8679\u8272&#xff0c;\u5c31\u50cf\u9ed1\u591c\u91cc\u7684\u8424\u706b\u866b\u624d\u663e\u773c\u3002\u76f8\u673a\u4f4d\u7f6e\u5f88\u5173\u952e&#xff0c;\u592a\u8fd1\u4e86\u53ea\u80fd\u770b\u89c1\u51e0\u4e2a\u7c92\u5b50\u7684 \u201c\u5927\u8138\u201d&#xff0c;\u592a\u8fdc\u4e86\u5c31\u6210\u829d\u9ebb\u4e86\u3002<\/p>\n<h4 id=\"3.%20%E8%AF%B7%20%E2%80%9C%E6%91%84%E5%BD%B1%E5%B8%88%E2%80%9D%EF%BC%88%E6%B8%B2%E6%9F%93%E5%99%A8%EF%BC%89\">3. \u8bf7 \u201c\u6444\u5f71\u5e08\u201d&#xff08;\u6e32\u67d3\u5668&#xff09;<\/h4>\n<p>\u821e\u53f0\u642d\u597d\u4e86&#xff0c;\u5f97\u6709\u4eba\u628a\u753b\u9762\u62cd\u51fa\u6765\u7ed9\u89c2\u4f17\u770b&#xff1a;<\/p>\n<p>let renderer &#061; new THREE.WebGLRenderer({ antialias: true }); \/\/ \u6444\u5f71\u5e08&#xff0c;\u5e26\u6297\u952f\u9f7f&#xff08;\u753b\u9762\u66f4\u7ec6\u817b&#xff09;<br \/>\nrenderer.setSize(innerWidth, innerHeight); \/\/ \u7167\u7247\u5c3a\u5bf8&#xff1a;\u548c\u7a97\u53e3\u4e00\u6837\u5927<br \/>\ndocument.body.appendChild(renderer.domElement); \/\/ \u628a\u7167\u7247\u8d34\u5230\u7f51\u9875\u4e0a  <\/p>\n<p>\u5410\u69fd&#xff1a;antialias: true\u5c31\u50cf\u7ed9\u6444\u5f71\u5e08\u52a0\u4e86 \u201c\u7f8e\u989c\u6ee4\u955c\u201d&#xff0c;\u7c92\u5b50\u8fb9\u7f18\u4e0d\u4f1a\u6bdb\u6bdb\u7cd9\u7cd9\u3002\u6700\u540e\u4e00\u6b65\u662f\u628a\u6e32\u67d3\u7ed3\u679c \u201c\u9489\u201d \u5728\u7f51\u9875\u4e0a \u2014\u2014 \u4e0d\u7136\u89c2\u4f17\u770b\u5565&#xff1f;<\/p>\n<h4 id=\"4.%20%E8%AE%A9%E8%88%9E%E5%8F%B0%20%E2%80%9C%E4%BC%B8%E7%BC%A9%E8%87%AA%E5%A6%82%E2%80%9D%EF%BC%88%E7%AA%97%E5%8F%A3%E9%80%82%E9%85%8D%EF%BC%89\">4. \u8ba9\u821e\u53f0 \u201c\u4f38\u7f29\u81ea\u5982\u201d&#xff08;\u7a97\u53e3\u9002\u914d&#xff09;<\/h4>\n<p>\u89c2\u4f17\u53ef\u80fd\u4f1a\u653e\u5927\u7a97\u53e3&#xff0c;\u821e\u53f0\u5f97\u8ddf\u7740\u53d8&#xff1a;<\/p>\n<p>window.addEventListener(&#034;resize&#034;, () &#061;&gt; {<br \/>\n  camera.aspect &#061; innerWidth \/ innerHeight; \/\/ \u76f8\u673a\u955c\u5934\u6bd4\u4f8b\u8ddf\u7740\u7a97\u53e3\u53d8<br \/>\n  camera.updateProjectionMatrix(); \/\/ \u76f8\u673a\u201c\u91cd\u8c03\u7126\u8ddd\u201d<br \/>\n  renderer.setSize(innerWidth, innerHeight); \/\/ \u6444\u5f71\u5e08\u6362\u4e2a\u5c3a\u5bf8\u62cd<br \/>\n});  <\/p>\n<p>\u5410\u69fd&#xff1a;\u5c31\u50cf\u7535\u5f71\u9662\u7684\u5e55\u5e03&#xff0c;\u89c2\u4f17\u628a\u5385\u62c9\u5927\u4e86&#xff0c;\u5e55\u5e03\u4e5f\u5f97\u8ddf\u7740\u6491\u5927&#xff0c;\u4e0d\u7136\u753b\u9762\u4f1a\u53d8\u5f62\u3002\u8fd9\u91cc\u7684resize\u4e8b\u4ef6\u5c31\u662f \u201c\u5e55\u5e03\u8c03\u8282\u5668\u201d\u3002<\/p>\n<h4 id=\"5.%20%E7%BB%99%E8%A7%82%E4%BC%97%20%E2%80%9C%E6%93%8D%E6%8E%A7%E6%9D%83%E2%80%9D%EF%BC%88%E6%8E%A7%E5%88%B6%E5%99%A8%EF%BC%89\">5. \u7ed9\u89c2\u4f17 \u201c\u64cd\u63a7\u6743\u201d&#xff08;\u63a7\u5236\u5668&#xff09;<\/h4>\n<p>\u603b\u4e0d\u80fd\u53ea\u770b\u56fa\u5b9a\u89d2\u5ea6\u5427&#xff1f;\u5f97\u8ba9\u89c2\u4f17\u81ea\u5df1\u8f6c\u7740\u770b&#xff1a;<\/p>\n<p>let controls &#061; new OrbitControls(camera, renderer.domElement); \/\/ \u7ed9\u4e2a\u9065\u63a7\u5668<br \/>\ncontrols.enableDamping &#061; true; \/\/ \u62d6\u52a8\u540e\u6162\u6162\u505c\u4e0b&#xff0c;\u50cf\u5e26\u5239\u8f66\u7684\u8f6e\u6905<br \/>\ncontrols.enableZoom &#061; true; \/\/ \u5141\u8bb8\u7f29\u653e&#xff0c;\u60f3\u770b\u7ec6\u8282\u5c31\u51d1\u8fd1\u70b9  <\/p>\n<p>\u5410\u69fd&#xff1a;enableDamping\u662f\u4e2a\u597d\u4e1c\u897f&#xff0c;\u4e0d\u7136\u62d6\u52a8\u9f20\u6807\u4e00\u677e\u624b&#xff0c;\u753b\u9762 \u201c\u55d6\u201d \u5730\u98de\u51fa\u53bb&#xff0c;\u5bb9\u6613\u6655 3D\u3002\u5c31\u50cf\u73a9\u8fc7\u5c71\u8f66\u52a0\u4e86\u7f13\u505c&#xff0c;\u53cb\u597d&#xff01;<\/p>\n<h4 id=\"6.%20%E7%BB%99%E7%B2%92%E5%AD%90%20%E2%80%9C%E7%BC%96%E5%BA%8F%E5%8F%B7%E2%80%9D%EF%BC%88%E5%85%A8%E5%B1%80%E5%8F%98%E9%87%8F%EF%BC%89\">6. \u7ed9\u7c92\u5b50 \u201c\u7f16\u5e8f\u53f7\u201d&#xff08;\u5168\u5c40\u53d8\u91cf&#xff09;<\/h4>\n<p>\u8fd9\u4e48\u591a\u7c92\u5b50&#xff0c;\u5f97\u6709 \u201c\u70b9\u540d\u518c\u201d \u548c \u201c\u65f6\u95f4\u8868\u201d&#xff1a;<\/p>\n<p>let globalData &#061; { time: { value: 0 } }; \/\/ \u5168\u5c40\u8ba1\u65f6\u5668&#xff0c;\u7ed9\u7c92\u5b50\u770b\u65f6\u95f4\u7528<br \/>\nlet speeds &#061; []; \/\/ \u6bcf\u4e2a\u7c92\u5b50\u7684\u201c\u901f\u5ea6\u8868\u201d<br \/>\nlet directions &#061; []; \/\/ \u6bcf\u4e2a\u7c92\u5b50\u7684\u201c\u8fd0\u52a8\u65b9\u5411\u201d  <\/p>\n<p>\/\/ \u7ed9\u7c92\u5b50\u968f\u673a\u5206\u914d\u65b9\u5411\u548c\u901f\u5ea6<br \/>\nlet setDirection &#061; () &#061;&gt; {<br \/>\n  directions.push(<br \/>\n    Math.random() * 2 &#8211; 1, \/\/ X\u65b9\u5411&#xff1a;\u5de6(-1)\u5230\u53f3(1)<br \/>\n    Math.random() * 2 &#8211; 1, \/\/ Y\u65b9\u5411&#xff1a;\u4e0b(-1)\u5230\u4e0a(1)<br \/>\n    Math.random() * 2 &#8211; 1, \/\/ Z\u65b9\u5411&#xff1a;\u524d(-1)\u5230\u540e(1)<br \/>\n    Math.random() * 3 &#043; 1 \/\/ \u901f\u5ea6&#xff1a;1\u52304\u4e4b\u95f4<br \/>\n  );<br \/>\n};  <\/p>\n<p>\u5410\u69fd&#xff1a;\u5c31\u50cf\u7ed9\u6bcf\u4e2a\u5b66\u751f\u53d1 \u201c\u8fd0\u52a8\u624b\u73af\u201d&#xff0c;\u8bb0\u5f55\u4ed6\u4eec\u8dd1\u591a\u5feb\u3001\u5f80\u54ea\u8dd1\u3002Math.random() * 2 &#8211; 1\u8fd9\u62db\u5f88\u5999&#xff0c;\u76f4\u63a5\u628a\u968f\u673a\u6570\u4ece 0-1 \u53d8\u6210 &#8211; 1 \u5230 1&#xff0c;\u7701\u5f97\u518d\u7b97\u4e00\u904d\u3002<\/p>\n<h4 id=\"7.%20%E7%94%9F%E6%88%90%E7%AC%AC%E4%B8%80%E6%89%B9%20%E2%80%9C%E6%BC%94%E5%91%98%E2%80%9D%EF%BC%88%E7%B2%92%E5%AD%90%E6%95%B0%E7%BB%84%EF%BC%89\">7. \u751f\u6210\u7b2c\u4e00\u6279 \u201c\u6f14\u5458\u201d&#xff08;\u7c92\u5b50\u6570\u7ec4&#xff09;<\/h4>\n<p>\u5148\u6765 5 \u4e07\u4e2a\u7c92\u5b50\u6491\u573a\u9762&#xff1a;<\/p>\n<p>let particles &#061; new Array(50000).fill().map(() &#061;&gt; {<br \/>\n  speeds.push(Math.random() * 0.8 &#043; 0.2); \/\/ \u5927\u5c0f&#xff1a;0.2\u52301<br \/>\n  setDirection(); \/\/ \u5206\u914d\u65b9\u5411<br \/>\n  \/\/ \u968f\u673a\u4f4d\u7f6e&#xff1a;\u5728\u4e00\u4e2a\u7403\u91cc\u5206\u5e03<br \/>\n  return new THREE.Vector3(<br \/>\n    (Math.random() * 2 &#8211; 1) * 20, \/\/ X\u8303\u56f4&#xff1a;-20\u523020<br \/>\n    (Math.random() * 2 &#8211; 1) * 20, \/\/ Y\u8303\u56f4&#xff1a;-20\u523020<br \/>\n    (Math.random() * 2 &#8211; 1) * 20  \/\/ Z\u8303\u56f4&#xff1a;-20\u523020<br \/>\n  );<br \/>\n});  <\/p>\n<p>\u5410\u69fd&#xff1a;5 \u4e07\u4e2a\u7c92\u5b50\u542c\u8d77\u6765\u591a&#xff0c;\u4f46 Three.js \u625b\u5f97\u4f4f \u2014\u2014 \u5c31\u50cf\u6f14\u5531\u4f1a 5 \u4e07\u4eba&#xff0c;\u53ea\u8981\u573a\u5730\u591f\u5927&#xff08;\u6d4f\u89c8\u5668\u6027\u80fd\u591f&#xff09;&#xff0c;\u5c31\u4e0d\u4f1a\u6324\u7206\u3002Vector3\u662f\u7ed9\u6bcf\u4e2a\u7c92\u5b50 \u201c\u753b\u5750\u6807\u201d&#xff0c;\u8ba9\u5b83\u4eec\u522b\u624e\u5806\u3002<\/p>\n<h4 id=\"8.%20%E5%8A%A0%E6%9B%B4%E5%A4%9A%20%E2%80%9C%E7%BE%A4%E6%BC%94%E2%80%9D%EF%BC%88%E8%A1%A5%E5%85%85%E7%B2%92%E5%AD%90%EF%BC%89\">8. \u52a0\u66f4\u591a \u201c\u7fa4\u6f14\u201d&#xff08;\u8865\u5145\u7c92\u5b50&#xff09;<\/h4>\n<p>\u518d\u6765 10 \u4e07\u4e2a\u7c92\u5b50&#xff0c;\u8ba9\u573a\u9762\u66f4\u70b8&#xff1a;<\/p>\n<p>for (let i &#061; 0; i &lt; 100000; i&#043;&#043;) {<br \/>\n  let radius &#061; Math.random() * 50 &#043; 30; \/\/ \u8ddd\u79bb\u4e2d\u5fc330\u523080\u7684\u73af<br \/>\n  let angle &#061; Math.random() * Math.PI * 2; \/\/ \u7ed5\u5708\u89d2\u5ea6<br \/>\n  \/\/ \u73af\u5f62\u5206\u5e03&#xff1a;\u50cf\u571f\u661f\u73af\u4e00\u6837<br \/>\n  particles.push(new THREE.Vector3(<br \/>\n    Math.cos(angle) * radius, \/\/ X\u5750\u6807<br \/>\n    (Math.random() * 2 &#8211; 1) * 10, \/\/ Y\u5750\u6807&#xff1a;\u4e0a\u4e0b\u6d6e\u52a8<br \/>\n    Math.sin(angle) * radius  \/\/ Z\u5750\u6807<br \/>\n  ));<br \/>\n  speeds.push(Math.random() * 0.8 &#043; 0.2);<br \/>\n  setDirection();<br \/>\n}  <\/p>\n<p>\u5410\u69fd&#xff1a;\u8fd9\u6279\u7c92\u5b50\u662f \u201c\u5916\u56f4\u89c2\u4f17\u201d&#xff0c;\u7ad9\u5728\u8fdc\u5904\u5f53\u80cc\u666f\u3002\u7528\u6781\u5750\u6807\u7b97\u4f4d\u7f6e&#xff08;cos\u548csin&#xff09;&#xff0c;\u6bd4\u76f4\u63a5\u7528 XYZ \u7b80\u5355 \u2014\u2014 \u5c31\u50cf\u7b97\u5706\u5f62\u5e7f\u573a\u4e0a\u7684\u5ea7\u4f4d&#xff0c;\u7528\u89d2\u5ea6\u6bd4\u7528\u6a2a\u7eb5\u5750\u6807\u65b9\u4fbf\u3002<\/p>\n<h4 id=\"9.%20%E7%BB%99%E7%B2%92%E5%AD%90%20%E2%80%9C%E7%A9%BF%E8%A1%A3%E6%9C%8D%E2%80%9D%EF%BC%88%E5%87%A0%E4%BD%95%E4%BD%93%E5%92%8C%E6%9D%90%E8%B4%A8%EF%BC%89\">9. \u7ed9\u7c92\u5b50 \u201c\u7a7f\u8863\u670d\u201d&#xff08;\u51e0\u4f55\u4f53\u548c\u6750\u8d28&#xff09;<\/h4>\n<p>\u7c92\u5b50\u5149\u6709\u4f4d\u7f6e\u8fd8\u4e0d\u884c&#xff0c;\u5f97\u6709\u989c\u8272\u548c\u9020\u578b&#xff1a;<\/p>\n<p>\/\/ \u628a\u7c92\u5b50\u5750\u6807\u88c5\u8fdb\u201c\u51e0\u4f55\u4f53\u201d&#xff08;\u76f8\u5f53\u4e8e\u7ed9\u6f14\u5458\u5b9a\u7ad9\u4f4d&#xff09;<br \/>\nlet geometry &#061; new THREE.BufferGeometry().setFromPoints(particles);<br \/>\n\/\/ \u7ed9\u6bcf\u4e2a\u7c92\u5b50\u8d34\u201c\u5927\u5c0f\u6807\u7b7e\u201d\u548c\u201c\u65b9\u5411\u6807\u7b7e\u201d<br \/>\ngeometry.setAttribute(&#034;speed&#034;, new THREE.Float32BufferAttribute(speeds, 1));<br \/>\ngeometry.setAttribute(&#034;dir&#034;, new THREE.Float32BufferAttribute(directions, 4));  <\/p>\n<p>\/\/ \u7ed9\u7c92\u5b50\u505a\u201c\u8863\u670d\u201d&#xff08;\u6750\u8d28&#xff09;<br \/>\nlet material &#061; new THREE.PointsMaterial({<br \/>\n  size: 0.3, \/\/ \u57fa\u7840\u5927\u5c0f<br \/>\n  transparent: true, \/\/ \u5141\u8bb8\u900f\u660e&#xff08;\u624d\u6709\u6e10\u53d8\u6548\u679c&#xff09;<br \/>\n  blending: THREE.AdditiveBlending, \/\/ \u53e0\u52a0\u53d1\u5149&#xff08;\u50cf\u9713\u8679\u706f&#xff09;<br \/>\n  onBeforeCompile: (shader) &#061;&gt; { \/\/ \u81ea\u5b9a\u4e49\u201c\u9020\u578b\u5e08\u201d&#xff08;\u7740\u8272\u5668&#xff09;<br \/>\n    shader.uniforms.time &#061; globalData.time; \/\/ \u7ed9\u9020\u578b\u5e08\u770b\u65f6\u95f4<br \/>\n    \/\/ \u9876\u70b9\u7740\u8272\u5668&#xff1a;\u63a7\u5236\u7c92\u5b50\u8fd0\u52a8\u548c\u5927\u5c0f<br \/>\n    shader.vertexShader &#061; &#096;<br \/>\n      uniform float time;<br \/>\n      attribute float speed;<br \/>\n      attribute vec4 dir;<br \/>\n      varying vec3 vColor;<br \/>\n      ${shader.vertexShader}<br \/>\n    &#096;.replace(&#096;gl_PointSize &#061; size;&#096;, &#096;gl_PointSize &#061; size * speed;&#096;) \/\/ \u5927\u5c0f\u4e58\u901f\u5ea6&#xff08;\u5feb\u7684\u7c92\u5b50\u66f4\u5927&#xff09;<br \/>\n    .replace(&#096;#include &lt;begin_vertex&gt;&#096;, &#096;<br \/>\n      #include &lt;begin_vertex&gt;<br \/>\n      \/\/ \u6309\u65b9\u5411\u79fb\u52a8&#xff1a;\u65f6\u95f4\u8d8a\u4e45&#xff0c;\u8d70\u5f97\u8d8a\u8fdc<br \/>\n      transformed &#043;&#061; vec3(dir.x, dir.y, dir.z) * dir.w * time;<br \/>\n    &#096;)<br \/>\n    .replace(&#096;#include &lt;color_vertex&gt;&#096;, &#096;<br \/>\n      #include &lt;color_vertex&gt;<br \/>\n      \/\/ \u989c\u8272\u6e10\u53d8&#xff1a;\u4ece\u7ea2\u5230\u7d2b<br \/>\n      float hue &#061; mod(time * 0.1 &#043; gl_Position.x * 0.01, 1.0);<br \/>\n      vColor &#061; hsl2rgb(hue, 0.8, 0.5); \/\/ HSL\u8f6cRGB&#xff08;\u65b9\u4fbf\u8c03\u989c\u8272&#xff09;<br \/>\n    &#096;);  <\/p>\n<p>    \/\/ \u7247\u5143\u7740\u8272\u5668&#xff1a;\u63a7\u5236\u7c92\u5b50\u8fb9\u7f18\u6e10\u53d8<br \/>\n    shader.fragmentShader &#061; &#096;<br \/>\n      varying vec3 vColor;<br \/>\n      ${shader.fragmentShader}<br \/>\n    &#096;.replace(&#096;vec4 diffuseColor &#061; vec4( diffuse, opacity );&#096;, &#096;<br \/>\n      \/\/ \u4e2d\u5fc3\u4eae&#xff0c;\u8fb9\u7f18\u6697&#xff08;\u50cf\u5149\u6591&#xff09;<br \/>\n      float distance &#061; length(gl_PointCoord &#8211; 0.5);<br \/>\n      vec4 diffuseColor &#061; vec4(vColor, smoothstep(0.5, 0.1, distance));<br \/>\n    &#096;);  <\/p>\n<p>    \/\/ \u52a0\u4e2aHSL\u8f6cRGB\u7684\u5de5\u5177\u51fd\u6570&#xff08;\u7740\u8272\u5668\u91cc\u6ca1\u6709\u81ea\u5e26&#xff09;<br \/>\n    shader.fragmentShader &#061; &#096;<br \/>\n      vec3 hsl2rgb(float h, float s, float l) {<br \/>\n        vec3 rgb &#061; clamp(abs(mod(h * 6.0 &#043; vec3(0.0, 4.0, 2.0), 6.0) &#8211; 3.0) &#8211; 1.0, 0.0, 1.0);<br \/>\n        return l &#043; s * (rgb &#8211; 0.5) * (1.0 &#8211; abs(2.0 * l &#8211; 1.0));<br \/>\n      }<br \/>\n      ${shader.fragmentShader}<br \/>\n    &#096;;<br \/>\n  }<br \/>\n});  <\/p>\n<p>\u5410\u69fd&#xff1a;\u8fd9\u90e8\u5206\u662f \u201c\u6838\u5fc3\u9b54\u6cd5\u201d&#xff01;\u7740\u8272\u5668\u5c31\u50cf\u7ed9\u7c92\u5b50 \u201c\u5b9a\u5236\u52a8\u4f5c\u548c\u5986\u5bb9\u201d\u2014\u2014 \u8ba9\u5feb\u7684\u7c92\u5b50\u66f4\u5927&#xff0c;\u989c\u8272\u968f\u65f6\u95f4\u53d8\u8272&#xff0c;\u8fb9\u7f18\u6a21\u7cca\u50cf\u5149\u6591\u3002hsl2rgb\u662f\u4e2a\u5c0f\u6280\u5de7&#xff0c;\u7528 HSL \u8c03\u989c\u8272\u6bd4 RGB \u65b9\u4fbf\u591a\u4e86&#xff0c;\u968f\u4fbf\u6539\u4e2a hue \u503c\u5c31\u80fd\u6362\u6574\u5957\u8272\u7cfb\u3002<\/p>\n<h4 id=\"10.%20%E8%AE%A9%E6%BC%94%E5%91%98%20%E2%80%9C%E4%B8%8A%E5%8F%B0%E2%80%9D%EF%BC%88%E7%82%B9%E4%BA%91%E8%BF%9B%E5%9C%BA%E6%99%AF%EF%BC%89\">10. \u8ba9\u6f14\u5458 \u201c\u4e0a\u53f0\u201d&#xff08;\u70b9\u4e91\u8fdb\u573a\u666f&#xff09;<\/h4>\n<p>\u628a\u7a7f\u597d\u8863\u670d\u7684\u7c92\u5b50\u4eec\u8bf7\u4e0a\u821e\u53f0&#xff1a;<\/p>\n<p>let particleSystem &#061; new THREE.Points(geometry, material); \/\/ \u7ec4\u5408\u6210\u201c\u7c92\u5b50\u7fa4\u201d<br \/>\nscene.add(particleSystem); \/\/ \u4e0a\u53f0&#xff01;  <\/p>\n<p>\u5410\u69fd&#xff1a;Points\u5c31\u50cf \u201c\u7fa4\u6f14\u603b\u7ba1\u201d&#xff0c;\u628a\u6240\u6709\u7c92\u5b50\u6253\u5305\u6210\u4e00\u4e2a\u5bf9\u8c61&#xff0c;\u65b9\u4fbf\u7edf\u4e00\u63a7\u5236\u3002\u52a0\u8fdb\u573a\u666f\u540e&#xff0c;\u5b83\u4eec\u5c31\u7b97\u6b63\u5f0f \u201c\u767b\u573a\u201d \u4e86\u3002<\/p>\n<h4 id=\"11.%20%E5%BC%80%E5%A7%8B%20%E2%80%9C%E8%A1%A8%E6%BC%94%E2%80%9D%EF%BC%88%E6%B8%B2%E6%9F%93%E5%BE%AA%E7%8E%AF%EF%BC%89\">11. \u5f00\u59cb \u201c\u8868\u6f14\u201d&#xff08;\u6e32\u67d3\u5faa\u73af&#xff09;<\/h4>\n<p>\u8ba9\u7c92\u5b50\u4eec\u52a8\u8d77\u6765&#xff0c;\u6c38\u4e0d\u505c\u6b47&#xff1a;<\/p>\n<p>let clock &#061; new THREE.Clock(); \/\/ \u8ba1\u65f6\u5668<br \/>\nrenderer.setAnimationLoop(() &#061;&gt; {<br \/>\n  controls.update(); \/\/ \u5237\u65b0\u63a7\u5236\u5668&#xff08;\u963b\u5c3c\u6548\u679c\u9700\u8981&#xff09;<br \/>\n  globalData.time.value &#061; clock.getElapsedTime(); \/\/ \u66f4\u65b0\u5168\u5c40\u65f6\u95f4<br \/>\n  particleSystem.rotation.y &#061; clock.getElapsedTime() * 0.05; \/\/ \u6574\u4f53\u6162\u6162\u65cb\u8f6c<br \/>\n  renderer.render(scene, camera); \/\/ \u6bcf\u5e27\u62cd\u4e00\u5f20\u7167\u7247<br \/>\n});  <\/p>\n<p>\u5410\u69fd&#xff1a;setAnimationLoop\u662f \u201c\u5bfc\u6f14\u558a Action\u201d&#xff0c;\u8ba9\u6d4f\u89c8\u5668\u6bcf\u5e27\u90fd\u5237\u65b0\u753b\u9762\u3002\u6574\u4f53\u65cb\u8f6c\u662f\u4e2a\u5c0f\u5fc3\u673a&#xff0c;\u5c31\u7b97\u89c2\u4f17\u4e0d\u52a8\u9f20\u6807&#xff0c;\u4e5f\u80fd\u770b\u5230\u4e0d\u540c\u89d2\u5ea6\u7684\u6548\u679c\u3002<\/p>\n<h3 id=\"%E5%AE%8C%E6%95%B4%E4%BB%A3%E7%A0%81%EF%BC%88%E6%8A%84%E4%BD%9C%E4%B8%9A%E4%B8%93%E7%94%A8%EF%BC%89\">\u5b8c\u6574\u4ee3\u7801&#xff08;\u6284\u4f5c\u4e1a\u4e13\u7528&#xff09;<\/h3>\n<p>&lt;!DOCTYPE html&gt;<br \/>\n&lt;html lang&#061;&#034;en&#034;&gt;<br \/>\n&lt;head&gt;<br \/>\n  &lt;meta charset&#061;&#034;UTF-8&#034;&gt;<br \/>\n  &lt;meta name&#061;&#034;viewport&#034; content&#061;&#034;width&#061;device-width, initial-scale&#061;1.0&#034;&gt;<br \/>\n  &lt;title&gt;\u9713\u8679\u5f39\u5e55\u96e8&lt;\/title&gt;<br \/>\n  &lt;style&gt; body { margin: 0; overflow: hidden; } &lt;\/style&gt;<br \/>\n&lt;\/head&gt;<br \/>\n&lt;body&gt;<br \/>\n  &lt;script type&#061;&#034;module&#034;&gt;<br \/>\n    import * as THREE from &#034;https:\/\/cdn.skypack.dev\/three&#064;0.136.0&#034;;<br \/>\n    import { OrbitControls } from &#034;https:\/\/cdn.skypack.dev\/three&#064;0.136.0\/examples\/jsm\/controls\/OrbitControls&#034;;<br \/>\n    console.clear();  <\/p>\n<p>    \/\/ 1. \u821e\u53f0\u548c\u76f8\u673a<br \/>\n    let scene &#061; new THREE.Scene();<br \/>\n    scene.background &#061; new THREE.Color(0x000000);<br \/>\n    let camera &#061; new THREE.PerspectiveCamera(75, innerWidth \/ innerHeight, 0.1, 1000);<br \/>\n    camera.position.set(0, 5, 30);  <\/p>\n<p>    \/\/ 2. \u6e32\u67d3\u5668<br \/>\n    let renderer &#061; new THREE.WebGLRenderer({ antialias: true });<br \/>\n    renderer.setSize(innerWidth, innerHeight);<br \/>\n    document.body.appendChild(renderer.domElement);  <\/p>\n<p>    \/\/ 3. \u7a97\u53e3\u9002\u914d<br \/>\n    window.addEventListener(&#034;resize&#034;, () &#061;&gt; {<br \/>\n      camera.aspect &#061; innerWidth \/ innerHeight;<br \/>\n      camera.updateProjectionMatrix();<br \/>\n      renderer.setSize(innerWidth, innerHeight);<br \/>\n    });  <\/p>\n<p>    \/\/ 4. \u63a7\u5236\u5668<br \/>\n    let controls &#061; new OrbitControls(camera, renderer.domElement);<br \/>\n    controls.enableDamping &#061; true;  <\/p>\n<p>    \/\/ 5. \u7c92\u5b50\u6570\u636e<br \/>\n    let globalData &#061; { time: { value: 0 } };<br \/>\n    let speeds &#061; [];<br \/>\n    let directions &#061; [];<br \/>\n    let setDirection &#061; () &#061;&gt; {<br \/>\n      directions.push(<br \/>\n        Math.random() * 2 &#8211; 1,<br \/>\n        Math.random() * 2 &#8211; 1,<br \/>\n        Math.random() * 2 &#8211; 1,<br \/>\n        Math.random() * 3 &#043; 1<br \/>\n      );<br \/>\n    };  <\/p>\n<p>    \/\/ 6. \u751f\u6210\u7c92\u5b50<br \/>\n    let particles &#061; new Array(50000).fill().map(() &#061;&gt; {<br \/>\n      speeds.push(Math.random() * 0.8 &#043; 0.2);<br \/>\n      setDirection();<br \/>\n      return new THREE.Vector3(<br \/>\n        (Math.random() * 2 &#8211; 1) * 20,<br \/>\n        (Math.random() * 2 &#8211; 1) * 20,<br \/>\n        (Math.random() * 2 &#8211; 1) * 20<br \/>\n      );<br \/>\n    });  <\/p>\n<p>    \/\/ 7. \u8865\u5145\u7c92\u5b50<br \/>\n    for (let i &#061; 0; i &lt; 100000; i&#043;&#043;) {<br \/>\n      let radius &#061; Math.random() * 50 &#043; 30;<br \/>\n      let angle &#061; Math.random() * Math.PI * 2;<br \/>\n      particles.push(new THREE.Vector3(<br \/>\n        Math.cos(angle) * radius,<br \/>\n        (Math.random() * 2 &#8211; 1) * 10,<br \/>\n        Math.sin(angle) * radius<br \/>\n      ));<br \/>\n      speeds.push(Math.random() * 0.8 &#043; 0.2);<br \/>\n      setDirection();<br \/>\n    }  <\/p>\n<p>    \/\/ 8. \u51e0\u4f55\u4f53\u548c\u6750\u8d28<br \/>\n    let geometry &#061; new THREE.BufferGeometry().setFromPoints(particles);<br \/>\n    geometry.setAttribute(&#034;speed&#034;, new THREE.Float32BufferAttribute(speeds, 1));<br \/>\n    geometry.setAttribute(&#034;dir&#034;, new THREE.Float32BufferAttribute(directions, 4));  <\/p>\n<p>    \/\/ HSL\u8f6cRGB\u7684\u5de5\u5177\u51fd\u6570&#xff0c;\u5c06\u5728\u7740\u8272\u5668\u4e2d\u4f7f\u7528<br \/>\n    const hsl2rgbFunction &#061; &#096;<br \/>\n      vec3 hsl2rgb(float h, float s, float l) {<br \/>\n        vec3 rgb &#061; clamp(abs(mod(h * 6.0 &#043; vec3(0.0, 4.0, 2.0), 6.0) &#8211; 3.0) &#8211; 1.0, 0.0, 1.0);<br \/>\n        return l &#043; s * (rgb &#8211; 0.5) * (1.0 &#8211; abs(2.0 * l &#8211; 1.0));<br \/>\n      }<br \/>\n    &#096;;<\/p>\n<p>    let material &#061; new THREE.PointsMaterial({<br \/>\n      size: 0.3,<br \/>\n      transparent: true,<br \/>\n      blending: THREE.AdditiveBlending,<br \/>\n      onBeforeCompile: (shader) &#061;&gt; {<br \/>\n        shader.uniforms.time &#061; globalData.time;<br \/>\n        \/\/ \u9876\u70b9\u7740\u8272\u5668&#xff1a;\u63a7\u5236\u7c92\u5b50\u8fd0\u52a8\u548c\u5927\u5c0f&#xff0c;\u73b0\u5728\u5305\u542bhsl2rgb\u51fd\u6570<br \/>\n        shader.vertexShader &#061; &#096;<br \/>\n          uniform float time;<br \/>\n          attribute float speed;<br \/>\n          attribute vec4 dir;<br \/>\n          varying vec3 vColor;<br \/>\n          ${hsl2rgbFunction} \/\/ \u5728\u8fd9\u91cc\u6dfb\u52a0HSL\u8f6cRGB\u51fd\u6570<br \/>\n          ${shader.vertexShader}<br \/>\n        &#096;.replace(&#096;gl_PointSize &#061; size;&#096;, &#096;gl_PointSize &#061; size * speed;&#096;)<br \/>\n        .replace(&#096;#include &lt;begin_vertex&gt;&#096;, &#096;<br \/>\n          #include &lt;begin_vertex&gt;<br \/>\n          transformed &#043;&#061; vec3(dir.x, dir.y, dir.z) * dir.w * time;<br \/>\n        &#096;)<br \/>\n        .replace(&#096;#include &lt;color_vertex&gt;&#096;, &#096;<br \/>\n          #include &lt;color_vertex&gt;<br \/>\n          float hue &#061; mod(time * 0.1 &#043; gl_Position.x * 0.01, 1.0);<br \/>\n          vColor &#061; hsl2rgb(hue, 0.8, 0.5);<br \/>\n        &#096;);  <\/p>\n<p>        \/\/ \u7247\u5143\u7740\u8272\u5668&#xff1a;\u63a7\u5236\u7c92\u5b50\u8fb9\u7f18\u6e10\u53d8<br \/>\n        shader.fragmentShader &#061; &#096;<br \/>\n          varying vec3 vColor;<br \/>\n          ${hsl2rgbFunction} \/\/ \u5728\u8fd9\u91cc\u4e5f\u6dfb\u52a0HSL\u8f6cRGB\u51fd\u6570<br \/>\n          ${shader.fragmentShader}<br \/>\n        &#096;.replace(&#096;vec4 diffuseColor &#061; vec4( diffuse, opacity );&#096;, &#096;<br \/>\n          float distance &#061; length(gl_PointCoord &#8211; 0.5);<br \/>\n          vec4 diffuseColor &#061; vec4(vColor, smoothstep(0.5, 0.1, distance));<br \/>\n        &#096;);<br \/>\n      }<br \/>\n    });  <\/p>\n<p>    \/\/ 9. \u52a0\u5165\u573a\u666f\u5e76\u5faa\u73af<br \/>\n    let particleSystem &#061; new THREE.Points(geometry, material);<br \/>\n    scene.add(particleSystem);  <\/p>\n<p>    let clock &#061; new THREE.Clock();<br \/>\n    renderer.setAnimationLoop(() &#061;&gt; {<br \/>\n      controls.update();<br \/>\n      globalData.time.value &#061; clock.getElapsedTime();<br \/>\n      particleSystem.rotation.y &#061; clock.getElapsedTime() * 0.05;<br \/>\n      renderer.render(scene, camera);<br \/>\n    });<br \/>\n  &lt;\/script&gt;<br \/>\n&lt;\/body&gt;<br \/>\n&lt;\/html&gt;<\/p>\n<h3 id=\"%E6%80%BB%E7%BB%93%E4%B8%80%E4%B8%8B\">\u603b\u7ed3\u4e00\u4e0b<\/h3>\n<p>\u5176\u5b9e\u6838\u5fc3\u5c31\u662f&#xff1a;\u7528 Three.js \u642d 3D \u73af\u5883&#xff0c;\u7528\u7740\u8272\u5668\u7ed9\u7c92\u5b50 \u201c\u5b9a\u5236\u9020\u578b\u548c\u52a8\u4f5c\u201d&#xff0c;\u518d\u7528\u52a8\u753b\u5faa\u73af\u8ba9\u5b83\u4eec\u52a8\u8d77\u6765\u3002\u770b\u8d77\u6765\u590d\u6742&#xff0c;\u4f46\u62c6\u6210\u4e00\u6b65\u4e00\u6b65&#xff0c;\u5c31\u50cf\u642d\u79ef\u6728 \u2014\u2014 \u5148\u62fc\u5e95\u5ea7&#xff08;\u573a\u666f\u76f8\u673a&#xff09;&#xff0c;\u518d\u88c5\u96f6\u4ef6&#xff08;\u7c92\u5b50&#xff09;&#xff0c;\u6700\u540e\u62e7\u4e0a\u9a6c\u8fbe&#xff08;\u6e32\u67d3\u5faa\u73af&#xff09;\u3002<\/p>\n<p>\u8bd5\u8bd5\u6539\u6539\u4ee3\u7801\u91cc\u7684\u6570\u5b57&#xff1a;\u6bd4\u5982\u628a\u7c92\u5b50\u6570\u91cf\u6539\u6210 10 \u4e07&#xff0c;\u6216\u8005\u628a\u989c\u8272 HSL \u7684\u9971\u548c\u5ea6\u8c03\u4f4e&#xff0c;\u770b\u770b\u4f1a\u53d8\u6210\u5565\u6837\u3002\u6bd5\u7adf JS \u7684\u4e50\u8da3\u5c31\u5728\u4e8e&#xff1a;\u4f60\u6c38\u8fdc\u4e0d\u77e5\u9053\u6539\u4e2a\u6570\u5b57\u80fd\u73a9\u51fa\u4ec0\u4e48\u65b0\u82b1\u6837&#xff01;<\/p>\n<p>\u6700\u540e\u8bf4\u4e00\u53e5&#xff1a;\u522b\u518d\u8bf4 JS \u53ea\u80fd\u505a\u8868\u5355\u4e86&#xff0c;\u5b83\u80fd\u5728\u6d4f\u89c8\u5668\u91cc\u7ed9\u4f60\u653e\u4e00\u6574\u665a\u7684\u9713\u8679\u70df\u82b1 \u2014\u2014 \u8fd9\u5c31\u662f\u524d\u7aef\u7684\u6d6a\u6f2b\u554a&#xff01;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb133\u6b21\u3002\u672c\u6587\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528JavaScript\u548cThree.js\u5e93\u5728\u6d4f\u89c8\u5668\u4e2d\u521b\u5efa\u70ab\u9177\u76843D\u7c92\u5b50\u6548\u679c\uff0c\u5b9e\u73b0&quot;\u8d5b\u535a\u670b\u514b\u70df\u82b1\u79c0&quot;\u7684\u89c6\u89c9\u6548\u679c\u3002\u4e3b\u8981\u5185\u5bb9\u5305\u62ec\uff1a1\uff09\u5f15\u5165Three.js\u5e93\u642d\u5efa3D\u73af\u5883\uff1b2\uff09\u521b\u5efa\u573a\u666f\u3001\u76f8\u673a\u548c\u6e32\u67d3\u5668\uff1b3\uff09\u751f\u621015\u4e07\u4e2a\u5f69\u8272\u7c92\u5b50\u5e76\u8bbe\u7f6e\u968f\u673a\u8fd0\u52a8\u65b9\u5411\uff1b4\uff09\u901a\u8fc7\u7740\u8272\u5668\u63a7\u5236\u7c92\u5b50\u5927\u5c0f\u3001\u989c\u8272\u548c\u8fd0\u52a8\u8f68\u8ff9\uff1b5\uff09\u6dfb\u52a0\u4ea4\u4e92\u529f\u80fd\u8ba9\u7528\u6237\u53ef\u65cb\u8f6c\u89c6\u89d2\u89c2\u770b\u3002\u6587\u7ae0\u8be6\u7ec6\u8bb2\u89e3\u4e86\u6bcf\u4e2a\u5b9e\u73b0\u6b65\u9aa4\uff0c\u5e76\u63d0\u4f9b\u4e86\u5b8c\u6574\u4ee3\u7801\u793a\u4f8b\u3002\u8fd9\u4e2a\u6848\u4f8b\u5c55\u793a\u4e86JavaScript\u57283D\u56fe\u5f62\u5904\u7406\u65b9\u9762\u7684\u5f3a\u5927\u80fd\u529b\uff0c\u7a81\u7834\u4e86\u4f20\u7edf\u8868\u5355\u9a8c\u8bc1\u7684\u5c40\u9650\uff0c\u4e3a\u524d\u7aef\u5f00\u53d1\u5e26\u6765\u66f4\u591a\u521b\u610f\u53ef\u80fd\u3002<\/p>\n","protected":false},"author":2,"featured_media":54638,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[187,87,190],"topic":[],"class_list":["post-54639","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-javascript","tag-87","tag-190"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u524d\u7aef\u5c0f\u7ec3\u4e60 \u2014\u2014 \u9713\u8679\u5f39\u5e55\u96e8 (JS \u80fd\u5728\u6d4f\u89c8\u5668\u91cc\u653e\u70df\u82b1\uff01) - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/54639.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u524d\u7aef\u5c0f\u7ec3\u4e60 \u2014\u2014 \u9713\u8679\u5f39\u5e55\u96e8 (JS \u80fd\u5728\u6d4f\u89c8\u5668\u91cc\u653e\u70df\u82b1\uff01) - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb133\u6b21\u3002\u672c\u6587\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528JavaScript\u548cThree.js\u5e93\u5728\u6d4f\u89c8\u5668\u4e2d\u521b\u5efa\u70ab\u9177\u76843D\u7c92\u5b50\u6548\u679c\uff0c\u5b9e\u73b0&quot;\u8d5b\u535a\u670b\u514b\u70df\u82b1\u79c0&quot;\u7684\u89c6\u89c9\u6548\u679c\u3002\u4e3b\u8981\u5185\u5bb9\u5305\u62ec\uff1a1\uff09\u5f15\u5165Three.js\u5e93\u642d\u5efa3D\u73af\u5883\uff1b2\uff09\u521b\u5efa\u573a\u666f\u3001\u76f8\u673a\u548c\u6e32\u67d3\u5668\uff1b3\uff09\u751f\u621015\u4e07\u4e2a\u5f69\u8272\u7c92\u5b50\u5e76\u8bbe\u7f6e\u968f\u673a\u8fd0\u52a8\u65b9\u5411\uff1b4\uff09\u901a\u8fc7\u7740\u8272\u5668\u63a7\u5236\u7c92\u5b50\u5927\u5c0f\u3001\u989c\u8272\u548c\u8fd0\u52a8\u8f68\u8ff9\uff1b5\uff09\u6dfb\u52a0\u4ea4\u4e92\u529f\u80fd\u8ba9\u7528\u6237\u53ef\u65cb\u8f6c\u89c6\u89d2\u89c2\u770b\u3002\u6587\u7ae0\u8be6\u7ec6\u8bb2\u89e3\u4e86\u6bcf\u4e2a\u5b9e\u73b0\u6b65\u9aa4\uff0c\u5e76\u63d0\u4f9b\u4e86\u5b8c\u6574\u4ee3\u7801\u793a\u4f8b\u3002\u8fd9\u4e2a\u6848\u4f8b\u5c55\u793a\u4e86JavaScript\u57283D\u56fe\u5f62\u5904\u7406\u65b9\u9762\u7684\u5f3a\u5927\u80fd\u529b\uff0c\u7a81\u7834\u4e86\u4f20\u7edf\u8868\u5355\u9a8c\u8bc1\u7684\u5c40\u9650\uff0c\u4e3a\u524d\u7aef\u5f00\u53d1\u5e26\u6765\u66f4\u591a\u521b\u610f\u53ef\u80fd\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/54639.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-13T01:19:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813011948-689be834a0753.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/54639.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/54639.html\",\"name\":\"\u524d\u7aef\u5c0f\u7ec3\u4e60 \u2014\u2014 \u9713\u8679\u5f39\u5e55\u96e8 (JS \u80fd\u5728\u6d4f\u89c8\u5668\u91cc\u653e\u70df\u82b1\uff01) - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-08-13T01:19:51+00:00\",\"dateModified\":\"2025-08-13T01:19:51+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/54639.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/54639.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/54639.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u524d\u7aef\u5c0f\u7ec3\u4e60 \u2014\u2014 \u9713\u8679\u5f39\u5e55\u96e8 (JS \u80fd\u5728\u6d4f\u89c8\u5668\u91cc\u653e\u70df\u82b1\uff01)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u524d\u7aef\u5c0f\u7ec3\u4e60 \u2014\u2014 \u9713\u8679\u5f39\u5e55\u96e8 (JS \u80fd\u5728\u6d4f\u89c8\u5668\u91cc\u653e\u70df\u82b1\uff01) - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/54639.html","og_locale":"zh_CN","og_type":"article","og_title":"\u524d\u7aef\u5c0f\u7ec3\u4e60 \u2014\u2014 \u9713\u8679\u5f39\u5e55\u96e8 (JS \u80fd\u5728\u6d4f\u89c8\u5668\u91cc\u653e\u70df\u82b1\uff01) - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb133\u6b21\u3002\u672c\u6587\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528JavaScript\u548cThree.js\u5e93\u5728\u6d4f\u89c8\u5668\u4e2d\u521b\u5efa\u70ab\u9177\u76843D\u7c92\u5b50\u6548\u679c\uff0c\u5b9e\u73b0&quot;\u8d5b\u535a\u670b\u514b\u70df\u82b1\u79c0&quot;\u7684\u89c6\u89c9\u6548\u679c\u3002\u4e3b\u8981\u5185\u5bb9\u5305\u62ec\uff1a1\uff09\u5f15\u5165Three.js\u5e93\u642d\u5efa3D\u73af\u5883\uff1b2\uff09\u521b\u5efa\u573a\u666f\u3001\u76f8\u673a\u548c\u6e32\u67d3\u5668\uff1b3\uff09\u751f\u621015\u4e07\u4e2a\u5f69\u8272\u7c92\u5b50\u5e76\u8bbe\u7f6e\u968f\u673a\u8fd0\u52a8\u65b9\u5411\uff1b4\uff09\u901a\u8fc7\u7740\u8272\u5668\u63a7\u5236\u7c92\u5b50\u5927\u5c0f\u3001\u989c\u8272\u548c\u8fd0\u52a8\u8f68\u8ff9\uff1b5\uff09\u6dfb\u52a0\u4ea4\u4e92\u529f\u80fd\u8ba9\u7528\u6237\u53ef\u65cb\u8f6c\u89c6\u89d2\u89c2\u770b\u3002\u6587\u7ae0\u8be6\u7ec6\u8bb2\u89e3\u4e86\u6bcf\u4e2a\u5b9e\u73b0\u6b65\u9aa4\uff0c\u5e76\u63d0\u4f9b\u4e86\u5b8c\u6574\u4ee3\u7801\u793a\u4f8b\u3002\u8fd9\u4e2a\u6848\u4f8b\u5c55\u793a\u4e86JavaScript\u57283D\u56fe\u5f62\u5904\u7406\u65b9\u9762\u7684\u5f3a\u5927\u80fd\u529b\uff0c\u7a81\u7834\u4e86\u4f20\u7edf\u8868\u5355\u9a8c\u8bc1\u7684\u5c40\u9650\uff0c\u4e3a\u524d\u7aef\u5f00\u53d1\u5e26\u6765\u66f4\u591a\u521b\u610f\u53ef\u80fd\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/54639.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-08-13T01:19:51+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813011948-689be834a0753.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/54639.html","url":"https:\/\/www.wsisp.com\/helps\/54639.html","name":"\u524d\u7aef\u5c0f\u7ec3\u4e60 \u2014\u2014 \u9713\u8679\u5f39\u5e55\u96e8 (JS \u80fd\u5728\u6d4f\u89c8\u5668\u91cc\u653e\u70df\u82b1\uff01) - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-08-13T01:19:51+00:00","dateModified":"2025-08-13T01:19:51+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/54639.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/54639.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/54639.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u524d\u7aef\u5c0f\u7ec3\u4e60 \u2014\u2014 \u9713\u8679\u5f39\u5e55\u96e8 (JS \u80fd\u5728\u6d4f\u89c8\u5668\u91cc\u653e\u70df\u82b1\uff01)"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/54639","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=54639"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/54639\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/54638"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=54639"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=54639"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=54639"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=54639"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}