{"id":342274,"date":"2022-12-07T15:00:57","date_gmt":"2022-12-07T15:00:57","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=342274"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=342274","title":{"rendered":"<span>React: \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 3D-\u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0439<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ln\/sl\/vm\/lnslvm47hzpomb2f9bqwbm-zr5e.png\" data-src=\"https:\/\/habrastorage.org\/webt\/ln\/sl\/vm\/lnslvm47hzpomb2f9bqwbm-zr5e.png\"\/>  <\/p>\n<p>  \u041f\u0440\u0438\u0432\u0435\u0442, \u0434\u0440\u0443\u0437\u044c\u044f!<\/p>\n<p>  <\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435 \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u0432\u0430\u043c \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u0431\u044b\u0441\u0442\u0440\u044b\u0439, \u0445\u043e\u0442\u044f \u0438 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0441\u0431\u043e\u0440\u043a\u0438, \u0441\u043f\u043e\u0441\u043e\u0431 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430 3D-\u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0432 <a href=\"https:\/\/ru.reactjs.org\/\">React<\/a>.<\/p>\n<p>  <\/p>\n<p>\u041c\u044b \u0440\u0435\u0448\u0438\u043c 3 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433 \u0441\u0430\u043c\u043e\u043f\u0438\u0441\u043d\u043e\u0433\u043e 3D-\u043e\u0431\u044a\u0435\u043a\u0442\u0430;<\/li>\n<li>\u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433 \u0433\u043e\u0442\u043e\u0432\u043e\u0439 3D-\u043c\u043e\u0434\u0435\u043b\u0438;<\/li>\n<li>\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u044b\u0439 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0438 \u043c\u043e\u0434\u0435\u043b\u0438.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0417\u043d\u0430\u043d\u0438\u0435 \u0432\u0430\u043c\u0438 \u043e\u0441\u043d\u043e\u0432 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0442\u0440\u0435\u0445\u043c\u0435\u0440\u043d\u043e\u0439 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0439 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u043c.<\/p>\n<p>  <\/p>\n<p>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u043f\u043e\u0441\u043b\u0443\u0436\u0438\u043b\u0430 <a href=\"https:\/\/blog.openreplay.com\/implementing-3d-graphics-in-react\/\">\u044d\u0442\u0430 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u044d\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043f\u0440\u043e\u0448\u0443 \u043f\u043e\u0434 \u043a\u0430\u0442.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p>\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 3D-\u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0439 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438:<\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/threejs.org\/\">Three.js<\/a> \u2014 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u043e\u0431\u043b\u0435\u0433\u0447\u0430\u044e\u0449\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 <a href=\"https:\/\/developer.mozilla.org\/ru\/docs\/Web\/API\/WebGL_API\">WebGL<\/a>;<\/li>\n<li><a href=\"https:\/\/docs.pmnd.rs\/react-three-fiber\/getting-started\/introduction\">React Three Fiber<\/a> \u2014 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044f \u043d\u0430\u0434 <code>Three.js<\/code> \u0434\u043b\u044f <code>React<\/code> (\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b);<\/li>\n<li><a href=\"https:\/\/github.com\/pmndrs\/drei\">React Three Drei<\/a> \u2014 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044f \u043d\u0430\u0434 <code>React Three Fiber<\/code> (\u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438).<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0415\u0449\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0441\u0441\u044b\u043b\u043e\u043a:<\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/www.textures.com\/\">\u0442\u0435\u043a\u0441\u0442\u0443\u0440\u044b<\/a>;<\/li>\n<li><a href=\"https:\/\/sketchfab.com\/features\/gltf\">3D-\u043c\u043e\u0434\u0435\u043b\u0438<\/a>;<\/li>\n<li><a href=\"https:\/\/github.com\/CesiumGS\/gltf-pipeline\">glTF Pipeline<\/a> \u2014 <code>CLI<\/code> \u0434\u043b\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 <a href=\"https:\/\/github.com\/CesiumGS\/gltf-pipeline\">glTF<\/a>;<\/li>\n<li><a href=\"https:\/\/github.com\/pmndrs\/gltfjsx\">glTFJSX<\/a> \u2014 <code>CLI<\/code> \u0434\u043b\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439 <code>glTF<\/code> \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b <code>React<\/code>.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f <a href=\"https:\/\/yarnpkg.com\/\">Yarn<\/a>, \u0430 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u2014 <a href=\"https:\/\/vitejs.dev\/\">Vite<\/a>.<\/p>\n<p>  <\/p>\n<p><a href=\"https:\/\/github.com\/harryheman\/Blog-Posts\/tree\/master\/react-3d\">\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0441 \u043a\u043e\u0434\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/a>.<\/p>\n<p>  <\/p>\n<h2 id=\"podgotovka-i-nastroyka-proekta\">\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/h2>\n<p>  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\"># react-3d - \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 # react - \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d yarn create vite react-3d --template react<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e, \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">cd react-3d yarn yarn dev<\/code><\/pre>\n<p>  <\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">yarn add three @react-three\/fiber @react-three\/drei<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0442\u0438\u043b\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 <code>App.css<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">body {   margin: 0; }  canvas {   height: 100vh;   width: 100vw; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u0432\u0441\u0435, \u0447\u0442\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>  <\/p>\n<h2 id=\"rendering-3d-obekta\">\u0420\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433 3D-\u043e\u0431\u044a\u0435\u043a\u0442\u0430<\/h2>\n<p>  <\/p>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 &#171;Hello world&#187; \u043c\u0438\u0440\u0430 \u0442\u0440\u0435\u0445\u043c\u0435\u0440\u043d\u043e\u0439 \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u2014 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430 \u0441\u0444\u0435\u0440\u044b.<\/p>\n<p>  <\/p>\n<p>\u0420\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u0435 \u0433\u0440\u0430\u0444\u0438\u043a\u0438, \u043a\u0430\u043a \u0442\u0440\u0435\u0445\u043c\u0435\u0440\u043d\u043e\u0439, \u0442\u0430\u043a \u0438 \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u043e\u0439, \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0445\u043e\u043b\u0441\u0442\u0435 (<code>HTML-\u044d\u043b\u0435\u043c\u0435\u043d\u0442<\/code> <code>canvas<\/code>). <code>@react-three\/fiber<\/code> \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 <code>Canvas<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">\/\/ App.jsx import { Canvas } from \"@react-three\/fiber\"; import \".\/App.css\";  function App() {   return (     &lt;div className=\"App\">       &lt;Canvas         camera={{           fov: 90,           position: [0, 0, 3],         }}       >         {\/* todo *\/}       &lt;\/Canvas>     &lt;\/div>   ); }  export default App;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0445\u043e\u043b\u0441\u0442, \u043d\u043e \u0442\u0430\u043a\u0436\u0435 <a href=\"https:\/\/threejs.org\/manual\/#ru\/scenegraph\">\u0441\u0446\u0435\u043d\u0443 \u0438\u043b\u0438, \u0442\u043e\u0447\u043d\u0435\u0435, \u0433\u0440\u0430\u0444 \u0441\u0446\u0435\u043d\u044b<\/a> (scene), <a href=\"https:\/\/threejs.org\/manual\/#ru\/cameras\">\u043a\u0430\u043c\u0435\u0440\u0443<\/a> (camera) \u0438 <a href=\"https:\/\/threejs.org\/docs\/#api\/en\/renderers\/WebGLRenderer\">\u0440\u0435\u043d\u0434\u0435\u0440\u0435\u0440<\/a> (renderer). \u041f\u0440\u043e\u043f <code>camera<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043a\u0430\u043c\u0435\u0440\u044b:<\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/threejs.org\/docs\/#api\/en\/cameras\/PerspectiveCamera.fov\">fov<\/a> \u2014 \u043f\u043e\u043b\u0435 \u043e\u0431\u0437\u043e\u0440\u0430 (field of view);<\/li>\n<li><code>position<\/code> \u2014 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u0430\u043c\u0435\u0440\u044b (<code>[x, y, z]<\/code>).<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e <code>components<\/code> \u0438 \u0432 \u043d\u0435\u0439 \u2014 \u0444\u0430\u0439\u043b <code>Sphere.jsx<\/code> \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">export default function Sphere() {   return (     &lt;mesh position={[0, 0, -2]}>       &lt;sphereGeometry args={[2, 32]} \/>     &lt;\/mesh>   ); }<\/code><\/pre>\n<p>  <\/p>\n<p><em>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435<\/em>: \u0443 \u043d\u0430\u0441 \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b <code>mesh<\/code>, <code>sphereGeometry<\/code> \u0438 \u0434\u0440. \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d\u0438 \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0435\u043d \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 <code>three<\/code>.<\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 <code>mesh<\/code>? \u0415\u0441\u043b\u0438 \u043a\u043e\u0440\u043e\u0442\u043a\u043e, \u0442\u043e <code>Mesh<\/code> \u2014 \u044d\u0442\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0430\u044f \u0438\u0437 \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0438 \u0438\u043b\u0438 \u0444\u0438\u0433\u0443\u0440\u044b (geometry) \u0438 <a href=\"https:\/\/threejs.org\/manual\/#ru\/materials\">\u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430<\/a> (material). \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0438\u0437 <a href=\"https:\/\/threejs.org\/manual\/#ru\/primitives\">\u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043e\u0432<\/a>, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0445 <code>three<\/code> \u2014 <a href=\"https:\/\/threejs.org\/docs\/#api\/en\/geometries\/SphereGeometry\">SphereGeometry<\/a>. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u0444\u0435\u0440\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0434\u0438\u0443\u0441 (radius) \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u0448\u0438\u0440\u0438\u043d\u044b (widthSegments).<\/p>\n<p>  <\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/lc\/hd\/wq\/lchdwql5s-adc75e_cqnp8e6w48.png\" data-src=\"https:\/\/habrastorage.org\/webt\/lc\/hd\/wq\/lchdwql5s-adc75e_cqnp8e6w48.png\"\/>  <\/p>\n<p>  <\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u043a\u0440\u0430\u0441\u0438\u043c \u0441\u0444\u0435\u0440\u0443 \u0432 \u0441\u0432\u0435\u0442\u043b\u043e-\u0437\u0435\u043b\u0435\u043d\u044b\u0439 \u0446\u0432\u0435\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">&lt;mesh ref={meshRef} position={[0, 0, -2]}>   &lt;sphereGeometry args={[2, 32]} \/>   {\/* \u0446\u0432\u0435\u0442 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u043a\u0430\u043a \"lightgreen\", \u043d\u043e \u0447\u0430\u0449\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u043e\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 *\/}   &lt;meshStandardMaterial color={0x00ff00} \/> &lt;\/mesh><\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/s_\/8g\/lx\/s_8glxalfxs_6cwjlhdjjghstfs.png\" data-src=\"https:\/\/habrastorage.org\/webt\/s_\/8g\/lx\/s_8glxalfxs_6cwjlhdjjghstfs.png\"\/>  <\/p>\n<p>  <\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443 \u0441\u0444\u0435\u0440\u0430 \u0447\u0435\u0440\u043d\u0430\u044f? \u0427\u0435\u0433\u043e-\u0442\u043e \u044f\u0432\u043d\u043e \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442. \u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0444\u0438\u0437\u0438\u043a\u0438 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%A6%D0%B2%D0%B5%D1%82\">\u0446\u0432\u0435\u0442<\/a> \u2014 \u044d\u0442\u043e \u043e\u0449\u0443\u0449\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0447\u0435\u043b\u043e\u0432\u0435\u043a (\u0438\u043b\u0438 \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u2014 \u043a\u0430\u043c\u0435\u0440\u0430) \u043f\u0440\u0438 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u0438 \u0435\u043c\u0443 \u0432 \u0433\u043b\u0430\u0437 \u0441\u0432\u0435\u0442\u043e\u0432\u044b\u0445 \u043b\u0443\u0447\u0435\u0439. \u041d\u0430 \u043d\u0430\u0448\u0435\u0439 \u0441\u0446\u0435\u043d\u0435 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u0435\u043b\u044c (\u043a\u0430\u043c\u0435\u0440\u0430), \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 (\u0441\u0444\u0435\u0440\u0430), \u043d\u043e \u043d\u0435\u0442 \u0441\u0432\u0435\u0442\u0430 \u0438\u043b\u0438 <a href=\"https:\/\/threejs.org\/manual\/#ru\/lights\">\u043e\u0441\u0432\u0435\u0449\u0435\u043d\u0438\u044f<\/a>. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u044d\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">\/\/ App.jsx &lt;Canvas   camera={{     fov: 90,     position: [0, 0, 3],   }} >   &lt;ambientLight intensity={0.5} \/>   &lt;Sphere \/> &lt;\/Canvas><\/code><\/pre>\n<p>  <\/p>\n<p><a href=\"https:\/\/threejs.org\/docs\/index.html?q=ambient#api\/en\/lights\/AmbientLight\">AmbientLight<\/a> \u2014 \u044d\u0442\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u043e\u043a\u0440\u0443\u0436\u0430\u044e\u0449\u0435\u0433\u043e \u0441\u0432\u0435\u0442\u0430, \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e \u043f\u043e\u0434\u0441\u0432\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u0432\u0441\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0435\u0441\u044f \u043d\u0430 \u0441\u0446\u0435\u043d\u0435. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 <code>intensity<\/code> \u2014 \u0438\u043d\u0442\u0435\u043d\u0441\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0438\u043b\u0438 \u044f\u0440\u043a\u043e\u0441\u0442\u044c \u0441\u0432\u0435\u0442\u0430.<\/p>\n<p>  <\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/a8\/wp\/e3\/a8wpe3wo7fpt9loxpnxyun3rpci.png\" data-src=\"https:\/\/habrastorage.org\/webt\/a8\/wp\/e3\/a8wpe3wo7fpt9loxpnxyun3rpci.png\"\/>  <\/p>\n<p>  <\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0437\u0435\u043b\u0435\u043d\u044b\u0439 \u0446\u0432\u0435\u0442. \u041d\u043e \u043f\u043e\u0447\u0435\u043c\u0443 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u043a\u0440\u0443\u0433, \u0430 \u043d\u0435 \u0441\u0444\u0435\u0440\u0443? \u041e\u0442\u0432\u0435\u0442 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u0442\u0430\u043a\u0436\u0435 \u043a\u0440\u043e\u0435\u0442\u0441\u044f \u0432 \u043e\u0441\u0432\u0435\u0449\u0435\u043d\u0438\u0438. \u041e\u0431\u044a\u0435\u043c \u0444\u0438\u0433\u0443\u0440\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0432\u0435\u0442\u043e\u043c, \u0442\u043e\u0447\u043d\u0435\u0435, \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0441\u0432\u0435\u0442\u0430, \u0435\u0433\u043e \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u0438 \u0438\u043d\u0442\u0435\u043d\u0441\u0438\u0432\u043d\u043e\u0441\u0442\u044c\u044e. \u041d\u0430 \u043d\u0430\u0448\u0435\u0439 \u0441\u0446\u0435\u043d\u0435 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0441\u0432\u0435\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0441\u0432\u0435\u0449\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0438\u0445 \u043f\u043b\u043e\u0441\u043a\u0438\u043c\u0438. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a <a href=\"https:\/\/threejs.org\/docs\/index.html?q=dir#api\/en\/lights\/DirectionalLight\">\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u0432\u0435\u0442\u0430<\/a> (DirectionalLight):<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">&lt;Canvas   camera={{     fov: 90,     position: [0, 0, 3],   }} >   {\/* \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u043c \u0438\u043d\u0442\u0435\u043d\u0441\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u043e\u043a\u0440\u0443\u0436\u0430\u044e\u0449\u0435\u0433\u043e \u0441\u0432\u0435\u0442\u0430 *\/}   &lt;ambientLight intensity={0.1} \/>   &lt;directionalLight position={[1, 1, 1]} intensity={0.8} \/>   &lt;Sphere \/> &lt;\/Canvas><\/code><\/pre>\n<p>  <\/p>\n<p>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u0432\u0435\u0442\u0430 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u0432\u0435\u0440\u0445\u0443 \u0438 \u0441\u043f\u0440\u0430\u0432\u0430 \u043e\u0442 \u0441\u0444\u0435\u0440\u044b, \u043d\u0430 \u043e\u0442\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u0432 1 \u0435\u0434\u0438\u043d\u0438\u0446\u0443 \u043e\u0442 \u043d\u0435\u0435.<\/p>\n<p>  <\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/zr\/q8\/u_\/zrq8u_0m_2uo4rtb-fybikt-670.png\" data-src=\"https:\/\/habrastorage.org\/webt\/zr\/q8\/u_\/zrq8u_0m_2uo4rtb-fybikt-670.png\"\/>  <\/p>\n<p>  <\/p>\n<p>  <\/p>\n<p>\u0423\u0436\u0435 \u043b\u0443\u0447\u0448\u0435, \u043d\u043e \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u043c\u0443 \u0432\u043e\u0441\u043f\u0440\u0438\u044f\u0442\u0438\u044e \u043e\u0431\u044a\u0435\u043c\u0430 \u043c\u0435\u0448\u0430\u0435\u0442 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0433\u043b\u0430\u0434\u043a\u0430\u044f \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u044c \u0441\u0444\u0435\u0440\u044b. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u043c\u0435\u0441\u0442\u043e \u0446\u0432\u0435\u0442\u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u043a \u0441\u0444\u0435\u0440\u0435 \u043a\u0430\u043a\u0443\u044e-\u043d\u0438\u0431\u0443\u0434\u044c <a href=\"https:\/\/threejs.org\/manual\/#ru\/textures\">\u0442\u0435\u043a\u0441\u0442\u0443\u0440\u0443<\/a>, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <a href=\"https:\/\/www.textures.com\/download\/3DScans1050\/143129\">\u044d\u0442\u0443<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b, \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u0432 <code>grass.jpg<\/code> \u0438 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e <code>public<\/code>.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0442\u0435\u043a\u0441\u0442\u0443\u0440 \u0432 <code>three<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <a href=\"https:\/\/threejs.org\/docs\/index.html?q=texture#api\/en\/loaders\/TextureLoader\">TextureLoader<\/a>. \u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0435\u0433\u043e \u0438 \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u0443 \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435 \u0441\u0444\u0435\u0440\u044b:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">import { TextureLoader } from \"three\/src\/loaders\/TextureLoader\";  import texture from \"\/grass.jpg\";<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u0430\u0440\u0442\u044b \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u044b <code>@react-three\/fiber<\/code> \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0445\u0443\u043a <code>useLoader<\/code>. \u0424\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u043a\u0430\u0440\u0442\u0443 \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u0435\u0435 \u043a \u0444\u0438\u0433\u0443\u0440\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">\/\/ ! import { useLoader } from \"@react-three\/fiber\"; import { useRef } from \"react\"; import { TextureLoader } from \"three\/src\/loaders\/TextureLoader\";  import texture from \"\/grass.jpg\";  export default function Sphere() {   \/\/ !   const textureMap = useLoader(TextureLoader, texture);    return (     &lt;mesh ref={meshRef} position={[0, 0, -2]}>       &lt;sphereGeometry args={[2, 32]} \/>       {\/* ! *\/}       &lt;meshStandardMaterial map={textureMap} \/>     &lt;\/mesh>   ); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ni\/pz\/oi\/nipzoihkewulgg4afyvcuev1oug.png\" data-src=\"https:\/\/habrastorage.org\/webt\/ni\/pz\/oi\/nipzoihkewulgg4afyvcuev1oug.png\"\/>  <\/p>\n<p>  <\/p>\n<p>  <\/p>\n<p>\u041e\u0442\u043b\u0438\u0447\u043d\u043e, \u0441 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u043e\u043c 3D-\u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0431\u043e\u043b\u0435\u0435-\u043c\u0435\u043d\u0435\u0435 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c, \u043c\u043e\u0436\u043d\u043e \u0434\u0432\u0438\u0433\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<p>  <\/p>\n<h2 id=\"rendering-3d-modeli\">\u0420\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433 3D-\u043c\u043e\u0434\u0435\u043b\u0438<\/h2>\n<p>  <\/p>\n<p>\u041d\u0430\u043c \u043d\u0443\u0436\u043d\u0430 \u0433\u043e\u0442\u043e\u0432\u0430\u044f \u0442\u0440\u0435\u0445\u043c\u0435\u0440\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c. \u0420\u0430\u0437 \u0443\u0436 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 3D-\u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0441\u0444\u0435\u0440\u0443, \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u043e\u0445\u043e\u0436\u0435\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <a href=\"https:\/\/sketchfab.com\/3d-models\/earth-41fc80d85dfd480281f21b74b2de2faa#download\">\u044d\u0442\u0443 \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u043b\u0430\u043d\u0435\u0442\u044b \u0417\u0435\u043c\u043b\u044f<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 <code>glTF<\/code>:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/_-\/fd\/gf\/_-fdgfsqxbmakmwwy-wla8bdcle.png\" data-src=\"https:\/\/habrastorage.org\/webt\/_-\/fd\/gf\/_-fdgfsqxbmakmwwy-wla8bdcle.png\"\/>  <\/p>\n<p>  <\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u0430\u0440\u0445\u0438\u0432 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e <code>earth<\/code> \u0438 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u0435\u0435 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e <code>public<\/code>.<\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c 2 \u0432\u0435\u0449\u0438:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>gltf-pipeline<\/code>;<\/li>\n<li>\u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c <code>glTF<\/code> \u0432 <code>JSX<\/code>.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c <code>gltf-pipeline<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">yarn add global gltf-pipeline # \u0438\u043b\u0438 npm i -g gltf-pipeline<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430\u0445\u043e\u0434\u044f\u0441\u044c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <code>earth<\/code>, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">gltf-pipeline -i scene.gltf -o model.gltf -d<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0444\u0430\u0439\u043b\u0430 <code>model.gltf<\/code>. \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u0432 <code>earth.gltf<\/code> \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">npx gltfjsx earth.gltf<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0444\u0430\u0439\u043b\u0430 <code>Earth.js<\/code>:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/12\/jn\/ie\/12jnie79u55nb_fker6s_9_fdeo.png\" data-src=\"https:\/\/habrastorage.org\/webt\/12\/jn\/ie\/12jnie79u55nb_fker6s_9_fdeo.png\"\/>  <\/p>\n<p>  <\/p>\n<p>  <\/p>\n<p>\u041c\u0435\u043d\u044f\u0435\u043c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u043d\u0430 <code>.jsx<\/code> \u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c \u0435\u0433\u043e \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e <code>components<\/code>. \u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u0435\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">import React from \"react\"; import { useGLTF } from \"@react-three\/drei\";  export default function Earth() {   const { nodes, materials } = useGLTF(\"\/earth\/earth.gltf\");    return (     &lt;group rotation={[-Math.PI \/ 2, 0, 0]}>       &lt;group rotation={[Math.PI \/ 2, 0, 0]}>         &lt;group rotation={[-Math.PI \/ 2, 0, 0]}>           &lt;mesh             ref={meshRef}             geometry={nodes.Sphere_Material002_0.geometry}             material={materials[\"Material.002\"]}           \/>         &lt;\/group>       &lt;\/group>     &lt;\/group>   ); }  useGLTF.preload(\"\/earth\/earth.gltf\");<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0438 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0432 <code>App.tsx<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">\/\/ ... import Earth from \".\/components\/Earth\";  function App() {   return (     &lt;div className=\"App\">       &lt;Canvas         camera={{           fov: 90,           position: [0, 0, 3],         }}       >         &lt;ambientLight intensity={0.1} \/>         &lt;directionalLight position={[1, 1, 1]} intensity={0.8} \/>         {\/* ! *\/}         &lt;Earth \/>       &lt;\/Canvas>     &lt;\/div>   ); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ng\/o8\/tp\/ngo8tp74ooeau6wb12jpaugfmyq.png\" data-src=\"https:\/\/habrastorage.org\/webt\/ng\/o8\/tp\/ngo8tp74ooeau6wb12jpaugfmyq.png\"\/>  <\/p>\n<p>  <\/p>\n<p>  <\/p>\n<p>\u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0417\u0435\u043c\u043b\u044f. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u043c \u0435\u0435 \u0432\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 <code>mesh<\/code> \u0438 \u0445\u0443\u043a <code>useFrame<\/code>, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0445 <code>@react-three\/fiber<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">\/\/ Earth.jsx import React, { useRef } from \"react\"; import { useGLTF } from \"@react-three\/drei\"; \/\/ ! import { useFrame } from \"@react-three\/fiber\";  export default function Earth() {   \/\/ !   const meshRef = useRef(null);   \/\/ requestAnimationFrame   \/\/ \u043f\u043e\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c `mesh` \u043f\u043e \u043e\u0441\u0438 `z` \u043d\u0430 0.003 \u0435\u0434\u0438\u043d\u0438\u0446\u044b 60 \u0440\u0430\u0437 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 (\u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b)   useFrame(() => (meshRef.current.rotation.z += 0.003));    const { nodes, materials } = useGLTF(\"\/earth\/earth.gltf\");    return (     &lt;group rotation={[-Math.PI \/ 2, 0, 0]}>       &lt;group rotation={[Math.PI \/ 2, 0, 0]}>         &lt;group rotation={[-Math.PI \/ 2, 0, 0]}>           &lt;mesh             \/\/ !             ref={meshRef}             geometry={nodes.Sphere_Material002_0.geometry}             material={materials[\"Material.002\"]}           \/>         &lt;\/group>       &lt;\/group>     &lt;\/group>   ); }  useGLTF.preload(\"\/earth\/earth.gltf\");<\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/q-\/y7\/ub\/q-y7ub4jnknjjk_jrw5i0pnvnn4.gif\" data-src=\"https:\/\/habrastorage.org\/webt\/q-\/y7\/ub\/q-y7ub4jnknjjk_jrw5i0pnvnn4.gif\"\/>  <\/p>\n<p>  <\/p>\n<p>  <\/p>\n<p>\u041a\u0440\u0443\u0442\u043e! \u041d\u043e \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0447\u0435\u0433\u043e-\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u0440\u043e\u043a\u043e\u0432\u043e\u0433\u043e (\u0443\u0434\u0430\u0440\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0441\u0430\u043c\u0438)).<\/p>\n<p>  <\/p>\n<h2 id=\"rendering-obekta-i-modeli\">\u0420\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0438 \u043c\u043e\u0434\u0435\u043b\u0438<\/h2>\n<p>  <\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u0433\u043e \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0438 \u043c\u043e\u0434\u0435\u043b\u0438. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u044f \u0445\u043e\u0447\u0443 \u043e\u0442\u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u043f, \u043f\u0430\u0440\u044f\u0449\u0438\u0439 \u043d\u0430\u0434 \u0432\u044b\u0436\u0436\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u044c\u044e (why not?).<\/p>\n<p>  <\/p>\n<p>\u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c <a href=\"https:\/\/www.textures.com\/download\/PBR1076\/143454\">\u044d\u0442\u0443 \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u0443<\/a>, \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u0435\u0435 \u0432 <code>lava.jpg<\/code> \u0438 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e <code>public<\/code>.<\/p>\n<p>  <\/p>\n<p>\u0420\u0435\u043d\u0434\u0435\u0440\u0438\u043c \u0432\u044b\u0436\u0436\u0435\u043d\u043d\u0443\u044e \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u044c \u0432 <code>App.jsx<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">import { Canvas, useLoader } from \"@react-three\/fiber\"; import { DoubleSide, TextureLoader } from \"three\"; import \".\/App.css\";  import texture from \"\/lava.jpg\";  function App() {   const textureMap = useLoader(TextureLoader, texture);    return (     &lt;div className=\"App\">       &lt;Canvas         camera={{           fov: 90,           position: [0, 0, 3],         }}       >         &lt;ambientLight intensity={0.1} \/>         &lt;directionalLight position={[1, 1, 1]} intensity={0.8} \/>         {\/* ! *\/}         &lt;mesh rotation={[-Math.PI \/ 2, 0, 0]} position={[0, -1.4, 0]}>           &lt;planeGeometry args={[10, 10]} \/>           &lt;meshStandardMaterial map={textureMap} side={DoubleSide} \/>         &lt;\/mesh>       &lt;\/Canvas>     &lt;\/div>   ); }  export default App;<\/code><\/pre>\n<p>  <\/p>\n<p><a href=\"https:\/\/threejs.org\/docs\/index.html?q=plane#api\/en\/geometries\/PlaneGeometry\">PlaneGeometry<\/a> \u2014 \u044d\u0442\u043e \u043f\u043b\u043e\u0441\u043a\u0438\u0439 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a. \u041f\u0440\u043e\u043f <code>side<\/code> \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c <code>DoubleSide<\/code> \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u0443 \u043a \u043e\u0431\u0435\u0438\u043c \u0441\u0442\u043e\u0440\u043e\u043d\u0430\u043c \u0444\u0438\u0433\u0443\u0440\u044b. \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043d\u0438\u0436\u043d\u044f\u044f \u0441\u0442\u043e\u0440\u043e\u043d\u0430 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0430 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0438 \u043a\u0430\u043c\u0435\u0440\u044b (\u043e\u0431 \u044d\u0442\u043e\u043c \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435) \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u0447\u0435\u0437\u0430\u0442\u044c.<\/p>\n<p>  <\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/9q\/ym\/-z\/9qym-z1n0qm4vzmc__1eh-kqpcu.png\" data-src=\"https:\/\/habrastorage.org\/webt\/9q\/ym\/-z\/9qym-z1n0qm4vzmc__1eh-kqpcu.png\"\/>  <\/p>\n<p>  <\/p>\n<p>  <\/p>\n<p>\u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c <a href=\"https:\/\/sketchfab.com\/3d-models\/skull-downloadable-1a9db900738d44298b0bc59f68123393\">\u044d\u0442\u0443 \u043c\u043e\u0434\u0435\u043b\u044c<\/a>, \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u0430\u0440\u0445\u0438\u0432 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e <code>skull<\/code> \u0438 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u0435\u0435 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e <code>public<\/code>.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c \u0448\u0430\u0433\u0438 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0430 \u0434\u043b\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 <code>React<\/code>.<\/p>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b <code>Skull.js<\/code> \u0432 <code>Skull.jsx<\/code>, \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u043c \u0435\u0433\u043e \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e <code>components<\/code> \u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">import { useGLTF } from \"@react-three\/drei\"; import React, { useRef } from \"react\";  export default function Skull() {   const { nodes, materials } = useGLTF(\"\/skull\/skull.gltf\");  return (     &lt;mesh       rotation={[-Math.PI \/ 2, 0, 0]}       geometry={nodes.Object_2.geometry}       material={materials.defaultMat}     \/>   ); }  useGLTF.preload(\"\/skull\/skull.gltf\");<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0438 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0432 <code>App.jsx<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">import { Canvas, useLoader } from \"@react-three\/fiber\"; import { DoubleSide, TextureLoader } from \"three\"; import \".\/App.css\"; \/\/ ! import Skull from \".\/components\/Skull\";  import texture from \"\/lava.jpg\";  function App() {   const textureMap = useLoader(TextureLoader, texture);    return (     &lt;div className=\"App\">       &lt;Canvas         camera={{           fov: 90,           position: [0, 0, 3],         }}       >         &lt;ambientLight intensity={0.1} \/>         &lt;directionalLight position={[1, 1, 1]} intensity={0.8} \/>         {\/* ! *\/}         &lt;Skull \/>         &lt;mesh rotation={[-Math.PI \/ 2, 0, 0]} position={[0, -1.4, 0]}>           &lt;planeGeometry args={[10, 10]} \/>           &lt;meshStandardMaterial map={textureMap} side={DoubleSide} \/>         &lt;\/mesh>       &lt;\/Canvas>     &lt;\/div>   ); }  export default App;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/_d\/m8\/uf\/_dm8uf4s1cd8ynenkt67wf2u8fo.png\" data-src=\"https:\/\/habrastorage.org\/webt\/_d\/m8\/uf\/_dm8uf4s1cd8ynenkt67wf2u8fo.png\"\/>  <\/p>\n<p>  <\/p>\n<p>  <\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0448\u0442\u0440\u0438\u0445\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a\u0430\u043c\u0435\u0440\u044b \u0432\u043e\u043a\u0440\u0443\u0433 \u0446\u0435\u043b\u0438 \u0438\u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f (target). \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0446\u0435\u043b\u044c \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442\u0441\u044f \u043d\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0441 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c\u0438 <code>0, 0, 0<\/code>. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u043d\u0435 \u043c\u0435\u043d\u044f\u043b\u0438 \u043f\u043e\u0437\u0438\u0446\u0438\u044e <code>mesh<\/code> \u0432 <code>Skull.jsx<\/code>, \u043a\u0430\u043c\u0435\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u0432\u043e\u043a\u0440\u0443\u0433 \u0447\u0435\u0440\u0435\u043f\u0430.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u0442\u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 <code>OrbitControls<\/code>, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0439 <code>@react-three\/drei<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">\/\/ App.jsx \/\/ ! import { OrbitControls } from \"@react-three\/drei\"; import { Canvas, useLoader } from \"@react-three\/fiber\"; import { DoubleSide, TextureLoader } from \"three\"; import \".\/App.css\"; import Skull from \".\/components\/Skull\";  import texture from \"\/lava.jpg\";  function App() {   const textureMap = useLoader(TextureLoader, texture);    return (     &lt;div className=\"App\">       &lt;Canvas         camera={{           fov: 90,           position: [0, 0, 3],         }}       >         &lt;ambientLight intensity={0.1} \/>         &lt;directionalLight position={[1, 1, 1]} intensity={0.8} \/>         {\/* ! *\/}         &lt;OrbitControls \/>         &lt;Skull \/>         &lt;mesh rotation={[-Math.PI \/ 2, 0, 0]} position={[0, -1.4, 0]}>           &lt;planeGeometry args={[10, 10]} \/>           &lt;meshStandardMaterial map={textureMap} side={DoubleSide} \/>         &lt;\/mesh>       &lt;\/Canvas>     &lt;\/div>   ); }  export default App;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/5r\/n7\/vf\/5rn7vfnt4fnrsxo_bf6vyy60xew.gif\" data-src=\"https:\/\/habrastorage.org\/webt\/5r\/n7\/vf\/5rn7vfnt4fnrsxo_bf6vyy60xew.gif\"\/>  <\/p>\n<p>  <\/p>\n<p>  <\/p>\n<p>\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u043e\u043f\u0430 <code>enableZoom<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">&lt;OrbitControls enableZoom={false} \/><\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0436\u0430\u043b\u0443\u0439, \u044d\u0442\u043e \u0432\u0441\u0435, \u0447\u0435\u043c \u044f \u0445\u043e\u0442\u0435\u043b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0432\u0430\u043c\u0438 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<p>  <\/p>\n<p><em>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435<\/em>: \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043b\u0438\u0448\u044c \u0432\u0435\u0440\u0445\u0443\u0448\u043a\u0443 \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u0430\u0439\u0441\u0431\u0435\u0440\u0433\u0430 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c &#171;\u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0442\u0440\u0435\u0445\u043c\u0435\u0440\u043d\u043e\u0439 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0439 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435&#187;, \u0442\u0430\u043a \u0447\u0442\u043e \u0434\u0435\u0440\u0437\u0430\u0439\u0442\u0435.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0432\u044b \u0443\u0437\u043d\u0430\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043d\u043e\u0432\u043e\u0435 \u0438 \u043d\u0435 \u0437\u0440\u044f \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u043b\u0438 \u0432\u0440\u0435\u043c\u044f.<\/p>\n<p>  <\/p>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0438 happy coding!<\/p>\n<p>  <\/p>\n<hr\/>\n<p>  <\/p>\n<p><a href=\"https:\/\/timeweb.cloud\/?utm_source=habr&amp;utm_medium=banner&amp;utm_campaign=vds-promo-6-rub\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/p-\/u9\/l2\/p-u9l27ynelxi92bcmdxhu76ma8.png\" data-src=\"https:\/\/habrastorage.org\/webt\/p-\/u9\/l2\/p-u9l27ynelxi92bcmdxhu76ma8.png\"\/><\/a><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/timeweb\/blog\/704024\/\"> https:\/\/habr.com\/ru\/company\/timeweb\/blog\/704024\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ln\/sl\/vm\/lnslvm47hzpomb2f9bqwbm-zr5e.png\" data-src=\"https:\/\/habrastorage.org\/webt\/ln\/sl\/vm\/lnslvm47hzpomb2f9bqwbm-zr5e.png\"\/>  <\/p>\n<p>  \u041f\u0440\u0438\u0432\u0435\u0442, \u0434\u0440\u0443\u0437\u044c\u044f!<\/p>\n<p>  <\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435 \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u0432\u0430\u043c \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u0431\u044b\u0441\u0442\u0440\u044b\u0439, \u0445\u043e\u0442\u044f \u0438 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0441\u0431\u043e\u0440\u043a\u0438, \u0441\u043f\u043e\u0441\u043e\u0431 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430 3D-\u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0432 <a href=\"https:\/\/ru.reactjs.org\/\">React<\/a>.<\/p>\n<p>  <\/p>\n<p>\u041c\u044b \u0440\u0435\u0448\u0438\u043c 3 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433 \u0441\u0430\u043c\u043e\u043f\u0438\u0441\u043d\u043e\u0433\u043e 3D-\u043e\u0431\u044a\u0435\u043a\u0442\u0430;<\/li>\n<li>\u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433 \u0433\u043e\u0442\u043e\u0432\u043e\u0439 3D-\u043c\u043e\u0434\u0435\u043b\u0438;<\/li>\n<li>\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u044b\u0439 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0438 \u043c\u043e\u0434\u0435\u043b\u0438.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0417\u043d\u0430\u043d\u0438\u0435 \u0432\u0430\u043c\u0438 \u043e\u0441\u043d\u043e\u0432 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0442\u0440\u0435\u0445\u043c\u0435\u0440\u043d\u043e\u0439 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0439 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u043c.<\/p>\n<p>  <\/p>\n<p>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u043f\u043e\u0441\u043b\u0443\u0436\u0438\u043b\u0430 <a href=\"https:\/\/blog.openreplay.com\/implementing-3d-graphics-in-react\/\">\u044d\u0442\u0430 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u044d\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043f\u0440\u043e\u0448\u0443 \u043f\u043e\u0434 \u043a\u0430\u0442.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-342274","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/342274","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=342274"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/342274\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=342274"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=342274"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=342274"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}