{"id":59229,"date":"2026-01-13T14:19:59","date_gmt":"2026-01-13T06:19:59","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/59229.html"},"modified":"2026-01-13T14:19:59","modified_gmt":"2026-01-13T06:19:59","slug":"three-js%e5%88%9d%e5%b0%9d%e8%af%95%ef%bc%88%e5%88%9d%e5%ad%a6%e8%80%85%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b0%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/59229.html","title":{"rendered":"Three.js\u521d\u5c1d\u8bd5\uff08\u521d\u5b66\u8005\u5b66\u4e60\u7b14\u8bb0\uff09"},"content":{"rendered":"<h2>\u9879\u76ee\u90e8\u7f72<\/h2>\n<p># 1. \u521b\u5efa Vite \u9879\u76ee<br \/>\nnpm create vite&#064;latest my-threejs-project<\/p>\n<\/p>\n<p># 2. \u8fdb\u5165\u9879\u76ee\u76ee\u5f55<br \/>\ncd my-threejs-project<\/p>\n<\/p>\n<p># 3. \u5b89\u88c5\u57fa\u7840\u4f9d\u8d56&#xff08;Vite\u3001Vue \u7b49&#xff09;<br \/>\nnpm install<\/p>\n<\/p>\n<p># 4. \u5b89\u88c5 Three.js<br \/>\nnpm install three<\/p>\n<\/p>\n<p># 5. \u3010\u53ef\u9009\u3011\u5982\u679c\u662f TypeScript \u9879\u76ee&#xff0c;\u5b89\u88c5\u7c7b\u578b\u5b9a\u4e49<br \/>\nnpm install &#8211;save-dev &#064;types\/three<br \/>\n# \u6ce8\u610f&#xff1a;\u8fd9\u662f\u4e3a TypeScript \u63d0\u4f9b\u7c7b\u578b\u63d0\u793a\u548c\u81ea\u52a8\u8865\u5168\u7684\u4f9d\u8d56&#xff0c;<br \/>\n# JavaScript \u9879\u76ee\u4e0d\u9700\u8981\u5b89\u88c5&#xff01;<\/p>\n<p>\u521b\u5efa\u5b8c\u540epackage.json\u4e2d\u4f9d\u8d56\u5982\u4e0b&#xff1a;<\/p>\n<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"101\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260113061958-6965e40ebf824.png\" width=\"311\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"271\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260113061958-6965e40ecced9.png\" width=\"492\" \/><\/p>\n<p>\u6709\u4e86\u4f9d\u8d56\u4e4b\u540e\u5728\u60f3\u4f7f\u7528three.js\u7684\u5730\u65b9\u5f15\u5165\u4f9d\u8d56\u5373\u53ef<\/p>\n<p>\/\/\u5f15\u5165three\u5e93<br \/>\nimport * as Three form &#039;three&#039;<\/p>\n<h2>\u5982\u4f55\u7528three.js\u521b\u5efa\u4e00\u4e2a\u51e0\u4f55\u4f53&#xff1f;<\/h2>\n<p>three.js\u6709\u6838\u5fc3\u4e09\u5927\u8981\u7d20&#xff1a;scene&#xff08;\u573a\u666f&#xff09;&#xff0c;camera&#xff08;\u76f8\u673a&#xff09;&#xff0c;renderer&#xff08;\u6e32\u67d3\u5668&#xff09;<\/p>\n<h3>1\u3001\u573a\u666f&#xff08;scene&#xff09;<\/h3>\n<p>3d\u4e16\u754c\u7684\u5bb9\u5668&#xff0c;\u76f8\u5f53\u4e8e\u4e00\u4e2a\u5c55\u793a\u7684\u821e\u53f0&#xff0c;\u7535\u5f71\u62cd\u6444\u7684\u6444\u5f71\u68da<\/p>\n<p>\/\/\u521b\u5efa\u4e00\u4e2a\u573a\u666f<br \/>\nconst scene&#061;new Three.Scene();<\/p>\n<p>\/\/ \u573a\u666f\u7684\u4e3b\u8981\u5c5e\u6027<br \/>\nscene.background &#061; new THREE.Color(0x87CEEB);  \/\/ \u80cc\u666f\u989c\u8272<br \/>\nscene.fog &#061; new THREE.Fog(0x000000, 10, 100);  \/\/ \u96fe\u5316\u6548\u679c<br \/>\nscene.environment &#061; environmentMap;  \/\/ \u73af\u5883\u8d34\u56fe<br \/>\nscene.overrideMaterial &#061; null;       \/\/ \u5f3a\u5236\u6240\u6709\u7269\u4f53\u4f7f\u7528\u540c\u4e00\u6750\u8d28<\/p>\n<h3>2\u3001\u76f8\u673a&#xff08;camera&#xff09;<\/h3>\n<p>\u76f8\u5f53\u4e8e\u89c2\u5bdf\u8005\u7684\u773c\u775b&#xff0c;\u51b3\u5b9a\u80fd\u770b\u5230\u4ec0\u4e48<\/p>\n<p>\u800c\u76f8\u673a\u5206\u4e3a\u4e24\u79cd&#xff1a;<\/p>\n<table border=\"1\" cellpadding=\"1\" cellspacing=\"1\" style=\"width:500px\">\n<tbody>\n<tr>\n<td>\u900f\u89c6\u76f8\u673a (PerspectiveCamera)<\/td>\n<td>\u6a21\u62df\u4eba\u773c\u89c6\u89d2&#xff0c;\u8fd1\u5927\u8fdc\u5c0f<\/td>\n<\/tr>\n<tr>\n<td>\u6b63\u4ea4\u76f8\u673a (OrthographicCamera)<\/td>\n<td>\u7b49\u8f74\u89c6\u56fe&#xff0c;\u65e0\u900f\u89c6\u53d8\u5f62<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\/\/\u521b\u5efa\u900f\u89c6\u76f8\u673a<br \/>\nconst camera &#061; new Three.PerspectiveCamera(<br \/>\n     45,\/\/\u89c6\u89d2&#xff0c;\u6570\u503c\u8d8a\u5927\u89c6\u89d2\u8d8a\u5927&#xff0c;\u770b\u5230\u7684\u4e1c\u897f\u8d8a\u591a(0-180)<br \/>\n    window.innerWidth \/ window.innerHeight,\/\/\u76f8\u673a\u5bbd\u9ad8\u6bd4,\u8bbe\u7f6e\u7684\u7a97\u53e3\u5927\u5c0f\u5bbd\u9ad8\u6bd4<br \/>\n    0.1,\/\/\u8fd1\u5e73\u9762&#xff0c;\u6700\u8fd1\u80fd\u770b\u5230\u7684\u7269\u4f53\u4f4d\u7f6e<br \/>\n    1000\/\/\u8fdc\u5e73\u9762&#xff0c;\u6700\u8fdc\u80fd\u770b\u5230\u7684\u7269\u4f53\u4f4d\u7f6e<br \/>\n);<\/p>\n<p>\/\/\u521b\u5efa\u6b63\u4ea4\u76f8\u673a<br \/>\nconst camera &#061;new Three.OrthographicCamera(<br \/>\n  left,    \/\/ \u5de6\u88c1\u526a\u9762<br \/>\n  right,   \/\/ \u53f3\u88c1\u526a\u9762<br \/>\n  top,     \/\/ \u4e0a\u88c1\u526a\u9762<br \/>\n  bottom,  \/\/ \u4e0b\u88c1\u526a\u9762<br \/>\n  near,    \/\/ \u8fd1\u88c1\u526a\u9762<br \/>\n  far      \/\/ \u8fdc\u88c1\u526a\u9762<br \/>\n);<\/p>\n<p>\u76f8\u673a\u901a\u5e38\u4f1a\u9884\u5148\u8bbe\u7f6e\u4e00\u4e9b\u5c5e\u6027&#xff0c;\u5982&#xff1a;<\/p>\n<ul>\n<li>\u4f4d\u7f6e camera.position.set()<\/li>\n<li>\u770b\u5411\u67d0\u4e2a\u70b9 camera.lookAt()<\/li>\n<li>\u7f29\u653e\u500d\u6570 camera.zoom &#061; ;<\/li>\n<\/ul>\n<h3>3\u3001\u6e32\u67d3\u5668&#xff08;renderer&#xff09;<\/h3>\n<p>\u5c063d\u7ed8\u5236\u52302d\u753b\u5e03&#xff0c;\u662f\u5c55\u793a\u7684\u4e2d\u6700\u540e\u4e00\u6b65<\/p>\n<p>const renderer &#061; new Three.WebGLRenderer({<br \/>\n  canvas: canvasElement,     \/\/ \u4f7f\u7528\u73b0\u6709canvas\u5143\u7d20<br \/>\n  antialias: true,           \/\/ \u5f00\u542f\u6297\u952f\u9f7f&#xff0c;\u6027\u80fd\u5f00\u9500\u5927<br \/>\n  alpha: true,               \/\/ \u900f\u660e\u80cc\u666f<br \/>\n  precision: &#034;highp&#034;,        \/\/ \u7cbe\u5ea6&#xff1a;highp\/mediump\/lowp<\/p>\n<p>})<\/p>\n<h2>\u521b\u5efa\u7269\u4f53\u7684\u5b8c\u6574\u6d41\u7a0b<\/h2>\n<h3>\u7b2c\u4e00\u6b65&#xff1a;\u51e0\u4f55\u4f53\u5b9a\u4e49\u5f62\u72b6<\/h3>\n<p>\u4e0b\u9762\u5c55\u793a\u4e0d\u540c\u7684\u5e38\u89c1\u57fa\u672c\u56fe\u5f62&#xff1a;<\/p>\n<p>\/\/1\u3001\u7acb\u65b9\u4f53<br \/>\nconst boxGeometry &#061; new Three.BoxGeometry();<\/p>\n<p>\/\/ \u9ed8\u8ba4\u503c<br \/>\nnew THREE.BoxGeometry(<br \/>\n  1,  \/\/ width: \u5bbd\u5ea6 &#061; 1<br \/>\n  1,  \/\/ height: \u9ad8\u5ea6 &#061; 1<br \/>\n  1,  \/\/ depth: \u6df1\u5ea6 &#061; 1<br \/>\n  1,  \/\/ widthSegments: \u5bbd\u5ea6\u5206\u6bb5\u6570 &#061; 1<br \/>\n  1,  \/\/ heightSegments: \u9ad8\u5ea6\u5206\u6bb5\u6570 &#061; 1<br \/>\n  1   \/\/ depthSegments: \u6df1\u5ea6\u5206\u6bb5\u6570 &#061; 1<br \/>\n);<\/p>\n<p>\/\/ \u6240\u4ee5\u4ee5\u4e0b\u4ee3\u7801\u521b\u5efa\u7684\u662f&#xff1a;<br \/>\nconst box &#061; new THREE.BoxGeometry();<br \/>\n\/\/ \u4e00\u4e2a 1\u00d71\u00d71 \u5927\u5c0f\u7684\u7acb\u65b9\u4f53&#xff0c;\u6ca1\u6709\u7ec6\u5206<br \/>\n\/\/ \u53ea\u67096\u4e2a\u9762&#xff0c;8\u4e2a\u9876\u70b9<\/p>\n<p>\/\/2\u3001\u7403\u4f53<br \/>\nconst sphereGeometry &#061; new Three.SphereGeometry();<\/p>\n<p>\/\/ \u9ed8\u8ba4\u503c<br \/>\nnew THREE.SphereGeometry(<br \/>\n  1,      \/\/ radius: \u534a\u5f84 &#061; 1<br \/>\n  32,     \/\/ widthSegments: \u6c34\u5e73\u5206\u6bb5\u6570 &#061; 32<br \/>\n  16,     \/\/ heightSegments: \u5782\u76f4\u5206\u6bb5\u6570 &#061; 16<br \/>\n  0,      \/\/ phiStart: \u6c34\u5e73\u8d77\u59cb\u89d2\u5ea6 &#061; 0<br \/>\n  Math.PI * 2,  \/\/ phiLength: \u6c34\u5e73\u626b\u63cf\u89d2\u5ea6 &#061; 2\u03c0&#xff08;360\u5ea6&#xff09;<br \/>\n  0,      \/\/ thetaStart: \u5782\u76f4\u8d77\u59cb\u89d2\u5ea6 &#061; 0<br \/>\n  Math.PI       \/\/ thetaLength: \u5782\u76f4\u626b\u63cf\u89d2\u5ea6 &#061; \u03c0&#xff08;180\u5ea6&#xff0c;\u5b8c\u6574\u7403\u4f53&#xff09;<br \/>\n);<\/p>\n<p>\/\/ \u6240\u4ee5\u4ee5\u4e0b\u4ee3\u7801\u521b\u5efa\u7684\u662f&#xff1a;<br \/>\nconst sphere &#061; new THREE.SphereGeometry();<br \/>\n\/\/ \u4e00\u4e2a\u534a\u5f84\u4e3a1\u7684\u5b8c\u6574\u7403\u4f53<br \/>\n\/\/ \u670932\u00d716&#061;512\u4e2a\u7ec6\u5206\u9762<\/p>\n<p>\/\/3\u3001\u5e73\u9762<br \/>\nconst planeGeometry &#061; new Three.PlaneGeometry();<\/p>\n<p>\/\/ \u9ed8\u8ba4\u503c<br \/>\nnew THREE.PlaneGeometry(<br \/>\n  1,  \/\/ width: \u5bbd\u5ea6 &#061; 1<br \/>\n  1,  \/\/ height: \u9ad8\u5ea6 &#061; 1<br \/>\n  1,  \/\/ widthSegments: \u5bbd\u5ea6\u5206\u6bb5\u6570 &#061; 1<br \/>\n  1   \/\/ heightSegments: \u9ad8\u5ea6\u5206\u6bb5\u6570 &#061; 1<br \/>\n);<\/p>\n<p>\/\/ \u6240\u4ee5\u4ee5\u4e0b\u4ee3\u7801\u521b\u5efa\u7684\u662f&#xff1a;<br \/>\nconst plane &#061; new THREE.PlaneGeometry();<br \/>\n\/\/ \u4e00\u4e2a1\u00d71\u5927\u5c0f\u7684\u5e73\u9762<br \/>\n\/\/ \u53ea\u67092\u4e2a\u4e09\u89d2\u9762&#xff0c;4\u4e2a\u9876\u70b9<\/p>\n<p>\/\/4\u3001\u5706\u67f1\u4f53<br \/>\nconst cylinderGeometry &#061; new Three.CylinderGeometry();<\/p>\n<p>\/\/ \u9ed8\u8ba4\u503c<br \/>\nnew THREE.CylinderGeometry(<br \/>\n  1,  \/\/ radiusTop: \u9876\u90e8\u534a\u5f84 &#061; 1<br \/>\n  1,  \/\/ radiusBottom: \u5e95\u90e8\u534a\u5f84 &#061; 1<br \/>\n  1,  \/\/ height: \u9ad8\u5ea6 &#061; 1<br \/>\n  8,  \/\/ radialSegments: \u5f84\u5411\u5206\u6bb5\u6570 &#061; 8<br \/>\n  1,  \/\/ heightSegments: \u9ad8\u5ea6\u5206\u6bb5\u6570 &#061; 1<br \/>\n  false,  \/\/ openEnded: \u662f\u5426\u5f00\u53e3 &#061; false<br \/>\n  0,  \/\/ thetaStart: \u8d77\u59cb\u89d2\u5ea6 &#061; 0<br \/>\n  Math.PI * 2  \/\/ thetaLength: \u626b\u63cf\u89d2\u5ea6 &#061; 2\u03c0&#xff08;360\u5ea6&#xff0c;\u5b8c\u6574\u5706\u67f1&#xff09;<br \/>\n);<\/p>\n<p>\/\/ \u6240\u4ee5\u4ee5\u4e0b\u4ee3\u7801\u521b\u5efa\u7684\u662f&#xff1a;<br \/>\nconst cylinder &#061; new THREE.CylinderGeometry();<br \/>\n\/\/ \u4e00\u4e2a\u9876\u90e8\u534a\u5f84&#061;1&#xff0c;\u5e95\u90e8\u534a\u5f84&#061;1&#xff0c;\u9ad8\u5ea6&#061;1\u7684\u5b8c\u6574\u5706\u67f1<br \/>\n\/\/ \u4fa7\u9762\u67098\u4e2a\u5206\u6bb5<\/p>\n<h3>\u7b2c\u4e8c\u6b65&#xff1a;\u6750\u8d28-\u5b9a\u4e49\u5916\u89c2<\/h3>\n<p>\u6750\u8d28\u7c7b\u578b\u5bf9\u6bd4<\/p>\n<table>\n<tr>\u6750\u8d28\u53d7\u5149\u6027\u80fd\u7279\u70b9\u7528\u9014<\/tr>\n<tbody>\n<tr>\n<td>\u200bMeshBasicMaterial\u200b<\/td>\n<td>\u274c \u5426<\/td>\n<td>\u9ad8<\/td>\n<td>\u4e0d\u53d7\u5149\u7167\u5f71\u54cd&#xff0c;\u7eaf\u8272\u6216\u7eb9\u7406<\/td>\n<td>\u57fa\u7840\u5c55\u793a<\/td>\n<\/tr>\n<tr>\n<td>\u200bMeshLambertMaterial\u200b<\/td>\n<td>\u2705 \u662f<\/td>\n<td>\u4e2d<\/td>\n<td>\u6f2b\u53cd\u5c04\u6750\u8d28&#xff0c;\u54d1\u5149\u6548\u679c<\/td>\n<td>\u5851\u6599\u3001\u5e03\u6599<\/td>\n<\/tr>\n<tr>\n<td>\u200bMeshPhongMaterial\u200b<\/td>\n<td>\u2705 \u662f<\/td>\n<td>\u4e2d<\/td>\n<td>\u955c\u9762\u9ad8\u5149&#xff0c;\u5149\u6cfd\u6548\u679c<\/td>\n<td>\u91d1\u5c5e\u3001\u73bb\u7483<\/td>\n<\/tr>\n<tr>\n<td>\u200bMeshStandardMaterial\u200b<\/td>\n<td>\u2705 \u662f<\/td>\n<td>\u4e2d<\/td>\n<td>\u57fa\u4e8e\u7269\u7406\u7684\u6e32\u67d3(PBR)<\/td>\n<td>\u771f\u5b9e\u611f\u6750\u8d28<\/td>\n<\/tr>\n<tr>\n<td>\u200bMeshPhysicalMaterial\u200b<\/td>\n<td>\u2705 \u662f<\/td>\n<td>\u4f4e<\/td>\n<td>\u6807\u51c6\u6750\u8d28\u7684\u6269\u5c55&#xff0c;\u66f4\u771f\u5b9e<\/td>\n<td>\u8f66\u6f06\u3001\u6e05\u6f06<\/td>\n<\/tr>\n<tr>\n<td>\u200bMeshNormalMaterial\u200b<\/td>\n<td>\u274c \u5426<\/td>\n<td>\u9ad8<\/td>\n<td>\u5c06\u6cd5\u7ebf\u663e\u793a\u4e3aRGB\u989c\u8272<\/td>\n<td>\u8c03\u8bd5\u7528<\/td>\n<\/tr>\n<tr>\n<td>\u200bMeshDepthMaterial\u200b<\/td>\n<td>\u274c \u5426<\/td>\n<td>\u9ad8<\/td>\n<td>\u663e\u793a\u6df1\u5ea6\u4fe1\u606f<\/td>\n<td>\u6df1\u5ea6\u56fe<\/td>\n<\/tr>\n<tr>\n<td>\u200bMeshMatcapMaterial\u200b<\/td>\n<td>\u274c \u5426<\/td>\n<td>\u9ad8<\/td>\n<td>\u6750\u8d28\u6355\u6349\u6750\u8d28<\/td>\n<td>\u98ce\u683c\u5316<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\/\/ \u57fa\u7840\u6750\u8d28\u793a\u4f8b<br \/>\nconst basicMaterial &#061; new THREE.MeshBasicMaterial({<br \/>\n  \/\/ \u57fa\u7840\u989c\u8272<br \/>\n  color: 0x00ff00,          \/\/ \u989c\u8272&#xff08;16\u8fdb\u5236&#xff09;<br \/>\n  opacity: 1.0,             \/\/ \u900f\u660e\u5ea6&#xff08;0-1&#xff09;<br \/>\n  transparent: false,      \/\/ \u662f\u5426\u900f\u660e&#xff08;opacity&lt;1\u65f6\u9700\u4e3atrue&#xff09;<br \/>\n  alphaTest: 0.5,           \/\/ \u900f\u660e\u5ea6\u6d4b\u8bd5\u9608\u503c<\/p>\n<p>  \/\/ \u7ebf\u6846\u6a21\u5f0f<br \/>\n  wireframe: false,         \/\/ \u662f\u5426\u663e\u793a\u4e3a\u7ebf\u6846<br \/>\n  wireframeLinewidth: 1,    \/\/ \u7ebf\u6846\u7ebf\u5bbd<\/p>\n<p>  \/\/ \u9762\u6e32\u67d3<br \/>\n  side: THREE.FrontSide,    \/\/ \u6e32\u67d3\u7684\u9762&#xff1a;FrontSide\/BackSide\/DoubleSide<br \/>\n  vertexColors: false,      \/\/ \u662f\u5426\u4f7f\u7528\u9876\u70b9\u989c\u8272<\/p>\n<p>  \/\/ \u8d34\u56fe<br \/>\n  map: colorMap,           \/\/ \u989c\u8272\u8d34\u56fe<br \/>\n  alphaMap: alphaMap,      \/\/ \u900f\u660e\u5ea6\u8d34\u56fe<br \/>\n  aoMap: aoMap,            \/\/ \u73af\u5883\u5149\u906e\u853d\u8d34\u56fe<br \/>\n  envMap: environmentMap,  \/\/ \u73af\u5883\u8d34\u56fe<\/p>\n<p>  \/\/ \u6df7\u5408\u6a21\u5f0f<br \/>\n  blending: THREE.NormalBlending,  \/\/ \u6df7\u5408\u6a21\u5f0f<br \/>\n  depthTest: true,         \/\/ \u6df1\u5ea6\u6d4b\u8bd5<br \/>\n  depthWrite: true,        \/\/ \u6df1\u5ea6\u5199\u5165<br \/>\n  polygonOffset: false,     \/\/ \u591a\u8fb9\u5f62\u504f\u79fb<br \/>\n});<\/p>\n<h3>\u7b2c\u4e09\u6b65&#xff1a;\u521b\u5efa\u7f51\u683c<\/h3>\n<p>\/\/ \u521b\u5efa\u7f51\u683c&#xff08;\u7ec4\u5408\u51e0\u4f55\u4f53\u548c\u6750\u8d28&#xff09;<br \/>\nconst mesh &#061; new THREE.Mesh(geometry, material);<\/p>\n<p>\/\/ \u4e5f\u53ef\u4ee5\u5148\u521b\u5efa\u540e\u6307\u5b9a\u6750\u8d28<br \/>\nconst mesh &#061; new THREE.Mesh(geometry);<br \/>\nmesh.material &#061; material;<\/p>\n<h3>\u603b\u7ed3\u4e00\u4e0b\u601d\u8def&#xff1a;<\/h3>\n<li>\u521b\u5efa\u4e00\u4e2a\u573a\u666f&#xff08;Scene&#xff09;\u4f5c\u4e3a\u5bb9\u5668\u3002<\/li>\n<li>\u521b\u5efa\u4e00\u4e2a\u6216\u591a\u4e2a\u76f8\u673a&#xff08;Camera&#xff09;\u6765\u5b9a\u4e49\u89c6\u89d2\u3002<\/li>\n<li>\u521b\u5efa\u4e00\u4e2a\u6e32\u67d3\u5668&#xff08;Renderer&#xff09;\u5e76\u8bbe\u7f6e\u5927\u5c0f&#xff0c;\u7136\u540e\u5c06\u6e32\u67d3\u5668\u7684\u753b\u5e03&#xff08;domElement&#xff09;\u6dfb\u52a0\u5230\u9875\u9762\u4e0a\u3002<\/li>\n<li>\u521b\u5efa\u51e0\u4f55\u4f53&#xff08;Geometry&#xff09;\u548c\u6750\u8d28&#xff08;Material&#xff09;&#xff0c;\u5c06\u5b83\u4eec\u7ec4\u5408\u6210\u7f51\u683c&#xff08;Mesh&#xff09;&#xff0c;\u7136\u540e\u628a\u7f51\u683c\u6dfb\u52a0\u5230\u573a\u666f\u4e2d\u3002<\/li>\n<li>\u4f7f\u7528\u6e32\u67d3\u5668&#xff0c;\u4f20\u5165\u573a\u666f\u548c\u76f8\u673a&#xff0c;\u8fdb\u884c\u6e32\u67d3\u3002<\/li>\n<h2>\u6838\u5fc3\u5bf9\u8c61\u7684\u5c42\u7ea7\u5173\u7cfb\u56fe<\/h2>\n<p>\u6e32\u67d3\u5668 (Renderer)<br \/>\n\u00a0 \u00a0 \u2502<br \/>\n\u00a0 \u00a0 \u2514\u2500\u2500 canvas\u5143\u7d20 (domElement)<br \/>\n\u00a0 \u00a0\u00a0<br \/>\n\u573a\u666f (Scene) \u2190 \u72ec\u7acb\u4e8e\u6e32\u67d3\u5668\u5b58\u5728<br \/>\n\u00a0 \u00a0 \u2502<br \/>\n\u00a0 \u00a0 \u251c\u2500\u2500 \u76f8\u673a (Camera) \u2190 \u53ef\u4ee5\u6dfb\u52a0\u5230\u573a\u666f&#xff0c;\u4f46\u4e0d\u662f\u5fc5\u987b<br \/>\n\u00a0 \u00a0 \u2502<br \/>\n\u00a0 \u00a0 \u251c\u2500\u2500 \u7f51\u683c (Mesh)<br \/>\n\u00a0 \u00a0 \u2502 \u00a0 \u251c\u2500\u2500 \u51e0\u4f55\u4f53 (Geometry) \u2190 \u88ab\u7f51\u683c\u5f15\u7528<br \/>\n\u00a0 \u00a0 \u2502 \u00a0 \u2514\u2500\u2500 \u6750\u8d28 (Material) \u2190 \u88ab\u7f51\u683c\u5f15\u7528<br \/>\n\u00a0 \u00a0 \u2502<br \/>\n\u00a0 \u00a0 \u251c\u2500\u2500 \u706f\u5149 (Light)<br \/>\n\u00a0 \u00a0 \u2502<br \/>\n\u00a0 \u00a0 \u251c\u2500\u2500 \u8f85\u52a9\u5bf9\u8c61 (AxesHelper, GridHelper)<br \/>\n\u00a0 \u00a0 \u2502<br \/>\n\u00a0 \u00a0 \u2514\u2500\u2500 \u5176\u4ed63D\u5bf9\u8c61<\/p>\n<h2>\u9996\u6b21\u5c1d\u8bd5\u6413\u51fa\u4e00\u4e2a\u81ea\u52a8\u65cb\u8f6c\u7684\u6b63\u65b9\u4f53<\/h2>\n<h3>\u4ee3\u7801<\/h3>\n<p>import { createApp } from &#039;vue&#039;<br \/>\nimport &#039;.\/style.css&#039;<br \/>\nimport App from &#039;.\/App.vue&#039;<br \/>\nimport *as Three from &#034;three&#034;<\/p>\n<p>createApp(App).mount(&#039;#app&#039;)<\/p>\n<p>\/\/1\u3001\u521b\u5efa\u573a\u666f<br \/>\nconst scene &#061; new Three.Scene();<\/p>\n<p>\/\/2\u3001\u521b\u5efa\u76f8\u673a&#xff08;\u900f\u89c6\u76f8\u673a&#xff09;<br \/>\nconst camera &#061; new Three.PerspectiveCamera(<br \/>\n    45,\/\/\u89c6\u89d2&#xff0c;\u6570\u503c\u8d8a\u5927\u89c6\u89d2\u8d8a\u5927&#xff0c;\u770b\u5230\u7684\u4e1c\u897f\u8d8a\u591a<br \/>\n    window.innerWidth \/ window.innerHeight,\/\/\u76f8\u673a\u5bbd\u9ad8\u6bd4\u8bbe\u7f6e\u7684\u7a97\u53e3\u5927\u5c0f\u5bbd\u9ad8\u6bd4<br \/>\n    0.1,\/\/\u8fd1\u5e73\u9762&#xff0c;\u6700\u8fd1\u80fd\u770b\u5230\u7684\u7269\u4f53\u4f4d\u7f6e<br \/>\n    1000\/\/\u8fdc\u5e73\u9762&#xff0c;\u6700\u8fdc\u80fd\u770b\u5230\u7684\u7269\u4f53\u4f4d\u7f6e<br \/>\n)<\/p>\n<p>\/\/3\u3001\u521b\u5efa\u6e32\u67d3\u5668<br \/>\nconst renderer &#061; new Three.WebGLRenderer();<br \/>\nrenderer.setSize(window.innerWidth, window.innerHeight);<br \/>\ndocument.body.appendChild(renderer.domElement);<\/p>\n<p>\/\/\u6d4b\u8bd5&#xff1a;\u521b\u5efa\u51e0\u4f55\u4f53<br \/>\nconst geometry &#061; new Three.BoxGeometry(1, 1, 1);<br \/>\n\/\/\u521b\u5efa\u6750\u8d28<br \/>\nconst material &#061; new Three.MeshBasicMaterial({ color: 0x00ff00 });<br \/>\n\/\/\u521b\u5efa\u7f51\u683c<br \/>\nconst cube &#061; new Three.Mesh(geometry, material);<\/p>\n<p>\/\/\u5c06\u7f51\u683c\u6dfb\u52a0\u5230\u573a\u666f\u4e2d<br \/>\nscene.add(cube);<\/p>\n<p>\/\/\u8bbe\u7f6e\u76f8\u673a\u4f4d\u7f6e<br \/>\ncamera.position.z &#061; 5;<br \/>\n\/\/\u76f8\u673a\u770b\u5411&#xff1f;<br \/>\ncamera.lookAt(0, 0, 0);<\/p>\n<p>\/\/\u52a8\u6001\u6e32\u67d3\u9644\u52a0\u51fd\u6570&#xff0c;\u6e32\u67d3<br \/>\nfunction animate() {<br \/>\n    requestAnimationFrame(animate);<\/p>\n<p>    \/\/\u5b9e\u73b0\u65cb\u8f6c<br \/>\n    cube.rotation.x &#043;&#061; 0.01;<br \/>\n    cube.rotation.y &#043;&#061; 0.01;<\/p>\n<p>    renderer.render(scene, camera);<br \/>\n}<\/p>\n<p>\/\/\u9759\u6001\u6e32\u67d3<br \/>\n\/\/ renderer.render(scene, camera);<br \/>\nanimate();<\/p>\n<h3>\u5173\u4e8e\u6e32\u67d3\u51fd\u6570<\/h3>\n<p>\u4ee3\u7801\u6240\u793a\u662f\u81ea\u52a8\u65cb\u8f6c&#xff0c;\u800c\u6e32\u67d3\u51fd\u6570\u7684\u6574\u4f53\u6b65\u9aa4\u548c\u7ed3\u6784\u5c31\u5e94\u8be5\u662f&#xff1a;<\/p>\n<p>&#xff08;1&#xff09;\u5728\u5916\u90e8\u63d0\u4f9b\u6e32\u67d3\u51fd\u6570\u5165\u53e3<\/p>\n<p>&#xff08;2&#xff09;\u5185\u90e8\u5148\u8c03\u7528requestAnimationFrame&#xff08;animate&#xff09;&#xff1b;<\/p>\n<p>&#xff08;3&#xff09;\u4e2d\u95f4\u5199\u53d8\u5316<\/p>\n<p>&#xff08;4&#xff09;\u7ed3\u5c3e\u91cd\u65b0\u6e32\u67d3renderer.render&#xff08;scene&#xff0c;camera&#xff09;&#xff1b;<\/p>\n<h4>\u7531\u4e8e\u597d\u5947\u6240\u4ee5\u53c8\u63a2\u7d22\u4e86\u5982\u4f55\u901a\u8fc7\u9f20\u6807\u6765\u65cb\u8f6c&#xff1a;<\/h4>\n<p>\u8981\u5f15\u5165Three\u5b98\u65b9\u7684\u51fd\u6570<\/p>\n<p>\/\/ \u5fc5\u987b\u5bfc\u5165 OrbitControls<br \/>\nimport { OrbitControls } from &#039;three\/examples\/jsm\/controls\/OrbitControls.js&#039;<\/p>\n<p>\u521b\u5efa\u63a7\u5236\u5668\u5bf9\u8c61&#xff1a;<\/p>\n<p>\/\/ 6\u3001\u521b\u5efa OrbitControls<br \/>\nconst controls &#061; new OrbitControls(camera, renderer.domElement);<\/p>\n<p>\/\/ 7\u3001\u914d\u7f6e\u63a7\u5236\u5668<br \/>\ncontrols.enableDamping &#061; true;      \/\/ \u542f\u7528\u963b\u5c3c&#xff08;\u60ef\u6027\u6548\u679c&#xff09;<br \/>\ncontrols.dampingFactor &#061; 0.05;     \/\/ \u963b\u5c3c\u7cfb\u6570<br \/>\ncontrols.rotateSpeed &#061; 0.5;        \/\/ \u65cb\u8f6c\u901f\u5ea6<br \/>\ncontrols.enableZoom &#061; true;        \/\/ \u5141\u8bb8\u7f29\u653e<br \/>\ncontrols.enablePan &#061; true;         \/\/ \u5141\u8bb8\u5e73\u79fb<br \/>\ncontrols.minDistance &#061; 2;          \/\/ \u6700\u5c0f\u7f29\u653e\u8ddd\u79bb<br \/>\ncontrols.maxDistance &#061; 10;         \/\/ \u6700\u5927\u7f29\u653e\u8ddd\u79bb<\/p>\n<p>\u5e76\u4e14\u7565\u5fae\u4fee\u6539\u6e32\u67d3\u51fd\u6570\u7684\u4e2d\u95f4\u4ee3\u7801&#xff1a;<\/p>\n<p>\/\/\u52a8\u6001\u6e32\u67d3\u9644\u52a0\u51fd\u6570&#xff0c;\u6e32\u67d3<br \/>\nfunction animate() {<br \/>\n    requestAnimationFrame(animate);<\/p>\n<p>    \/\/\u5b9e\u73b0\u65cb\u8f6c<br \/>\n    cube.rotation.x &#043;&#061; 0.01;<br \/>\n    cube.rotation.y &#043;&#061; 0.01;<br \/>\n    controls.update();<\/p>\n<p>    renderer.render(scene, camera);<br \/>\n}<\/p>\n<p>\u4e0a\u8ff0\u57fa\u672c\u8fc7\u7a0b\u5bf9\u4e8e\u5982\u4f55\u6574\u5408\u5230\u6846\u67b6\u4e2d\u4e0d\u518d\u8d58\u8ff0<\/p>\n<h2>\u6dfb\u52a0\u5750\u6807\u8f85\u52a9\u5668<\/h2>\n<p>\u6dfb\u52a0\u4e16\u754c\u5750\u6807\u7cfb\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u4e86\u89e3\u4f4d\u7f6e<\/p>\n<p> \/\/\u6dfb\u52a0\u4e16\u754c\u5750\u6807\u8f85\u52a9\u5668(\u53ef\u4ee5\u770b\u6210\u4e00\u4e2a\u7269\u4f53)<br \/>\n  const axesHelper &#061; new Three.AxesHelper(5);\/\/\u76f8\u5f53\u4e8e\u8bbe\u7f6e\u7ebf\u6bb5\u957f\u5ea6<br \/>\n  scene.add(axesHelper);<\/p>\n<h2>\u4e00\u4e2a\u7591\u95ee&#xff1a;canvas\u5230\u5e95\u662f\u4ec0\u4e48<\/h2>\n<p>\/\/ \u5f53\u4f60\u521b\u5efa\u6e32\u67d3\u5668\u65f6<br \/>\nconst renderer &#061; new THREE.WebGLRenderer();<\/p>\n<p>\/\/ \u5b9e\u9645\u4e0a\u5185\u90e8\u53d1\u751f\u4e86\u8fd9\u4e9b\u4e8b&#xff1a;<br \/>\n\/\/ 1. Three.js \u5728\u5185\u5b58\u4e2d\u521b\u5efa\u4e86\u4e00\u4e2a &lt;canvas&gt; \u5143\u7d20<br \/>\n\/\/ 2. \u5c06\u8fd9\u4e2a canvas \u5b58\u50a8\u5728 renderer.domElement<br \/>\n\/\/ 3. \u8bbe\u7f6e WebGL \u4e0a\u4e0b\u6587<\/p>\n<p>\/\/ \u8fd9\u4e2a canvas \u5143\u7d20\u662f&#xff1a;<br \/>\nconsole.log(renderer.domElement);  \/\/ \u8f93\u51fa: &lt;canvas&gt;&lt;\/canvas&gt;<br \/>\nconsole.log(renderer.domElement instanceof HTMLCanvasElement);  \/\/ true<\/p>\n<h2>\u753b\u5e03\u81ea\u9002\u5e94<\/h2>\n<p>\u4e3a\u4e86\u89e3\u51b3\u7528\u6237\u65f6\u800c\u4f1a\u6539\u53d8\u7a97\u53e3\u5927\u5c0f\u4f46\u753b\u5e03\u53ea\u6e32\u67d3\u4e00\u6b21\u7684\u95ee\u9898&#xff0c;\u73b0\u5728\u8981\u89e3\u51b3\u753b\u5e03\u81ea\u9002\u5e94<\/p>\n<p>\u4e3b\u8981\u662f\u66f4\u65b0\u76f8\u673a\u7684\u89c6\u89d2\u4ee5\u53ca\u6e32\u67d3\u5668\u7684\u5927\u5c0f&#xff08;\u5bbd\u9ad8&#xff09;<\/p>\n<p>window.addEventListener(&#039;resize&#039;, () &#061;&gt; {<br \/>\n  const width &#061; window.innerWidth;<br \/>\n  const height &#061; window.innerHeight;<\/p>\n<p>  \/\/ \u66f4\u65b0\u76f8\u673a<br \/>\n  camera.aspect &#061; width \/ height;<br \/>\n  camera.updateProjectionMatrix();<\/p>\n<p>  \/\/ \u66f4\u65b0\u6e32\u67d3\u5668<br \/>\n  renderer.setSize(width, height);<br \/>\n  renderer.setPixelRatio(window.devicePixelRatio);<br \/>\n});<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb231\u6b21\u3002\u672c\u6587\u7cfb\u7edf\u68b3\u7406\u4e86 three.js \u7684\u57fa\u7840\u4f7f\u7528\u6d41\u7a0b\u4e0e\u6838\u5fc3\u6982\u5ff5\uff1a\u4ece\u4f9d\u8d56\u5f15\u5165\u5f00\u59cb\uff0c\u56f4\u7ed5 Scene\uff08\u573a\u666f\uff09\u3001Camera\uff08\u76f8\u673a\uff09\u3001Renderer\uff08\u6e32\u67d3\u5668\uff09 \u4e09\u5927\u6838\u5fc3\u5bf9\u8c61\uff0c\u8bb2\u89e3\u4e86\u5982\u4f55\u521b\u5efa\u51e0\u4f55\u4f53\u3001\u6750\u8d28\u5e76\u7ec4\u5408\u6210\u7f51\u683c\u8fdb\u884c\u6e32\u67d3\uff1b\u4ecb\u7ecd\u4e86\u5e38\u89c1\u51e0\u4f55\u4f53\u4e0e\u6750\u8d28\u7c7b\u578b\u53ca\u5176\u7528\u9014\uff1b\u901a\u8fc7\u52a8\u753b\u6e32\u67d3\u51fd\u6570\u5b9e\u73b0\u7269\u4f53\u81ea\u52a8\u65cb\u8f6c\uff0c\u5e76\u7ed3\u5408 OrbitControls \u5b9e\u73b0\u9f20\u6807\u4ea4\u4e92\uff1b\u8865\u5145\u4e86\u5750\u6807\u8f74\u8f85\u52a9\u5668\u7528\u4e8e\u7a7a\u95f4\u7406\u89e3\uff1b\u8bf4\u660e\u4e86 WebGLRenderer \u5185\u90e8\u81ea\u52a8\u521b\u5efa\u5e76\u4f7f\u7528  \u7684\u673a\u5236\uff1b\u6700\u540e\u901a\u8fc7\u76d1\u542c\u7a97\u53e3 resize \u4e8b\u4ef6\u5b9e\u73b0\u753b\u5e03\u4e0e\u76f8\u673a\u7684\u81ea\u9002\u5e94\u66f4\u65b0\uff0c<\/p>\n","protected":false},"author":2,"featured_media":59227,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"topic":[],"class_list":["post-59229","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Three.js\u521d\u5c1d\u8bd5\uff08\u521d\u5b66\u8005\u5b66\u4e60\u7b14\u8bb0\uff09 - \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\/59229.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Three.js\u521d\u5c1d\u8bd5\uff08\u521d\u5b66\u8005\u5b66\u4e60\u7b14\u8bb0\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb231\u6b21\u3002\u672c\u6587\u7cfb\u7edf\u68b3\u7406\u4e86 three.js \u7684\u57fa\u7840\u4f7f\u7528\u6d41\u7a0b\u4e0e\u6838\u5fc3\u6982\u5ff5\uff1a\u4ece\u4f9d\u8d56\u5f15\u5165\u5f00\u59cb\uff0c\u56f4\u7ed5 Scene\uff08\u573a\u666f\uff09\u3001Camera\uff08\u76f8\u673a\uff09\u3001Renderer\uff08\u6e32\u67d3\u5668\uff09 \u4e09\u5927\u6838\u5fc3\u5bf9\u8c61\uff0c\u8bb2\u89e3\u4e86\u5982\u4f55\u521b\u5efa\u51e0\u4f55\u4f53\u3001\u6750\u8d28\u5e76\u7ec4\u5408\u6210\u7f51\u683c\u8fdb\u884c\u6e32\u67d3\uff1b\u4ecb\u7ecd\u4e86\u5e38\u89c1\u51e0\u4f55\u4f53\u4e0e\u6750\u8d28\u7c7b\u578b\u53ca\u5176\u7528\u9014\uff1b\u901a\u8fc7\u52a8\u753b\u6e32\u67d3\u51fd\u6570\u5b9e\u73b0\u7269\u4f53\u81ea\u52a8\u65cb\u8f6c\uff0c\u5e76\u7ed3\u5408 OrbitControls \u5b9e\u73b0\u9f20\u6807\u4ea4\u4e92\uff1b\u8865\u5145\u4e86\u5750\u6807\u8f74\u8f85\u52a9\u5668\u7528\u4e8e\u7a7a\u95f4\u7406\u89e3\uff1b\u8bf4\u660e\u4e86 WebGLRenderer \u5185\u90e8\u81ea\u52a8\u521b\u5efa\u5e76\u4f7f\u7528 \u7684\u673a\u5236\uff1b\u6700\u540e\u901a\u8fc7\u76d1\u542c\u7a97\u53e3 resize \u4e8b\u4ef6\u5b9e\u73b0\u753b\u5e03\u4e0e\u76f8\u673a\u7684\u81ea\u9002\u5e94\u66f4\u65b0\uff0c\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/59229.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-13T06:19:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260113061958-6965e40ebf824.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=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/59229.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/59229.html\",\"name\":\"Three.js\u521d\u5c1d\u8bd5\uff08\u521d\u5b66\u8005\u5b66\u4e60\u7b14\u8bb0\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-01-13T06:19:59+00:00\",\"dateModified\":\"2026-01-13T06:19:59+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/59229.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/59229.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/59229.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Three.js\u521d\u5c1d\u8bd5\uff08\u521d\u5b66\u8005\u5b66\u4e60\u7b14\u8bb0\uff09\"}]},{\"@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":"Three.js\u521d\u5c1d\u8bd5\uff08\u521d\u5b66\u8005\u5b66\u4e60\u7b14\u8bb0\uff09 - \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\/59229.html","og_locale":"zh_CN","og_type":"article","og_title":"Three.js\u521d\u5c1d\u8bd5\uff08\u521d\u5b66\u8005\u5b66\u4e60\u7b14\u8bb0\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb231\u6b21\u3002\u672c\u6587\u7cfb\u7edf\u68b3\u7406\u4e86 three.js \u7684\u57fa\u7840\u4f7f\u7528\u6d41\u7a0b\u4e0e\u6838\u5fc3\u6982\u5ff5\uff1a\u4ece\u4f9d\u8d56\u5f15\u5165\u5f00\u59cb\uff0c\u56f4\u7ed5 Scene\uff08\u573a\u666f\uff09\u3001Camera\uff08\u76f8\u673a\uff09\u3001Renderer\uff08\u6e32\u67d3\u5668\uff09 \u4e09\u5927\u6838\u5fc3\u5bf9\u8c61\uff0c\u8bb2\u89e3\u4e86\u5982\u4f55\u521b\u5efa\u51e0\u4f55\u4f53\u3001\u6750\u8d28\u5e76\u7ec4\u5408\u6210\u7f51\u683c\u8fdb\u884c\u6e32\u67d3\uff1b\u4ecb\u7ecd\u4e86\u5e38\u89c1\u51e0\u4f55\u4f53\u4e0e\u6750\u8d28\u7c7b\u578b\u53ca\u5176\u7528\u9014\uff1b\u901a\u8fc7\u52a8\u753b\u6e32\u67d3\u51fd\u6570\u5b9e\u73b0\u7269\u4f53\u81ea\u52a8\u65cb\u8f6c\uff0c\u5e76\u7ed3\u5408 OrbitControls \u5b9e\u73b0\u9f20\u6807\u4ea4\u4e92\uff1b\u8865\u5145\u4e86\u5750\u6807\u8f74\u8f85\u52a9\u5668\u7528\u4e8e\u7a7a\u95f4\u7406\u89e3\uff1b\u8bf4\u660e\u4e86 WebGLRenderer \u5185\u90e8\u81ea\u52a8\u521b\u5efa\u5e76\u4f7f\u7528 \u7684\u673a\u5236\uff1b\u6700\u540e\u901a\u8fc7\u76d1\u542c\u7a97\u53e3 resize \u4e8b\u4ef6\u5b9e\u73b0\u753b\u5e03\u4e0e\u76f8\u673a\u7684\u81ea\u9002\u5e94\u66f4\u65b0\uff0c","og_url":"https:\/\/www.wsisp.com\/helps\/59229.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-01-13T06:19:59+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260113061958-6965e40ebf824.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/59229.html","url":"https:\/\/www.wsisp.com\/helps\/59229.html","name":"Three.js\u521d\u5c1d\u8bd5\uff08\u521d\u5b66\u8005\u5b66\u4e60\u7b14\u8bb0\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-01-13T06:19:59+00:00","dateModified":"2026-01-13T06:19:59+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/59229.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/59229.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/59229.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Three.js\u521d\u5c1d\u8bd5\uff08\u521d\u5b66\u8005\u5b66\u4e60\u7b14\u8bb0\uff09"}]},{"@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\/59229","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=59229"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/59229\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/59227"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=59229"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=59229"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=59229"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=59229"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}