{"id":230323,"date":"2014-07-18T13:50:03","date_gmt":"2014-07-18T09:50:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=230323"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=230323","title":{"rendered":"<span class=\"post_title\">\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 WebGL \u0438\u0433\u0440\u044b Digital Trip<\/span>"},"content":{"rendered":"<div class=\"content html_format\">     \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/97a\/1a1\/f98\/97a1a1f980258da970bd8575c509cfd5.png\" alt=\"image\"\/><\/p>\n<p>  \u041f\u0440\u0438\u0432\u0435\u0442, \u0445\u0430\u0431\u0440! \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 WebGL \u0438\u0433\u0440\u044b Digital Trip. \u041f\u043e\u043c\u0438\u043c\u043e WebGL, \u0432 \u0438\u0433\u0440\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0442\u0430\u043a\u0438\u0435 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438, \u043a\u0430\u043a WebAudio API, WebSockets, getUserMedia, Vibration API, DeviceOrientation, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 three.js, hedtrackr.js, sicket.io \u0438 \u043f\u0440. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0443\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u0434\u0435\u0442\u0430\u043b\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u042f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u0434\u0432\u0438\u0436\u043a\u0435 \u0438\u0433\u0440\u044b, \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e, \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0432\u0435\u0431-\u043a\u0430\u043c\u0435\u0440\u043e\u0439, \u0441\u043a\u0430\u0436\u0443 \u043f\u0430\u0440\u0443 \u0441\u043b\u043e\u0432 \u043e back-end\u2019e \u043d\u0430 node.js, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u043c \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 \u0441 dogecoin \u0434\u0435\u043c\u043e\u043d\u043e\u043c.<br \/>  \u0412 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430 GitHub, \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438\u0433\u0440\u044b \u0438 \u0441\u0430\u043c\u0443 \u0438\u0433\u0440\u0443.<br \/>  \u0412\u0441\u0435\u0445, \u043a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043f\u0440\u043e\u0448\u0443 \u043f\u043e\u0434 \u043a\u0430\u0442.<br \/>  <a name=\"habracut\"><\/a><\/p>\n<p>  \u0413\u0435\u0439\u043c\u043f\u043b\u0435\u0439 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439: \u043b\u0435\u0442\u0438\u043c \u043f\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u0438, \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u043c\u043e\u043d\u0435\u0442\u043a\u0438 \u0438 \u0431\u043e\u043d\u0443\u0441\u044b, \u0443\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c\u0441\u044f \u043e\u0442 \u043a\u0430\u043c\u043d\u0435\u0439. \u041f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u0433\u0440\u043e\u043a\u0430 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u044b 3 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u043c\u0438. \u0411\u043e\u043d\u0443\u0441\u044b \u0431\u044b\u0432\u0430\u044e\u0442 \u0442\u0440\u0435\u0445 \u0442\u0438\u043f\u043e\u0432: \u0449\u0438\u0442 (HTML5), \u0437\u0430\u043c\u0435\u0434\u043b\u0435\u043d\u0438\u0435 (\u043a\u043e\u0442\u0438\u043a) \u0438\u043b\u0438 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0436\u0438\u0437\u043d\u0435\u0439 (\u0433\u0443\u0431\u044b). \u0412 \u043a\u043e\u043d\u0446\u0435 \u0438\u0433\u0440\u044b \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u043c\u043e\u043d\u0435\u0442\u043a\u0438 \u043d\u0430 \u0441\u0432\u043e\u0439 \u043a\u043e\u0448\u0435\u043b\u0435\u043a dogecoin.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/69c\/c71\/958\/69cc71958acee81fc0afbb226af56209.png\" alt=\"image\"\/><\/p>\n<p>  \u0426\u0435\u043b\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0433\u0440\u044b \u2014 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u0445 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043e\u0432, \u043f\u0440\u043e\u043a\u0430\u0447\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u043d\u0430\u0432\u044b\u043a\u0438, \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043e\u043f\u044b\u0442\u043e\u043c \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u0443\u0434\u043e\u0432\u043e\u043b\u044c\u0441\u0442\u0432\u0438\u0435 \u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430.<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044f\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<h4>\u0414\u0432\u0438\u0436\u043e\u043a \u0438\u0433\u0440\u044b \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u0442\u0430\u043b\u0438<\/h4>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0435\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f DT, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c, \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430\u043c \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0438 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430\u043c, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c-\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c, \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c \u0438 \u0442.\u0434.<\/p>\n<h5>\u041f\u0440\u0435\u043b\u043e\u0430\u0434\u0435\u0440<\/h5>\n<p>  \u041a \u0441\u0442\u0430\u043d\u0438\u0446\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u0442\u0440\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430:  <\/p>\n<pre><code class=\"html\">&lt;script src=&quot;js\/vendor\/jquery.min.js&quot;&gt;&lt;\/script&gt; &lt;script src=&quot;js\/vendor\/yepnope.1.5.4-min.js&quot;&gt;&lt;\/script&gt; &lt;script src=&quot;js\/myYepnope.min.js&quot;&gt;&lt;\/script&gt; <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 <a href=\"http:\/\/yepnopejs.com\/\">yepnope<\/a>.<br \/>  \u041f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 myYepnope.js \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 WebGL \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043e\u043c:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">var isWebGLSupported,     \tcanvas = document.getElementById('checkwebgl'); \tif (!window.WebGLRenderingContext) {     \t\/\/ Browser has no idea what WebGL is         isWebGLSupported = false; \t} else if (canvas.getContext(&quot;webgl&quot;) ||         canvas.getContext(&quot;webGlCanvas&quot;) || canvas.getContext(&quot;moz-webgl&quot;) || canvas.getContext(&quot;webkit-3d&quot;) || canvas.getContext(&quot;experimental-webgl&quot;)) {     \t\/\/ Can get context         isWebGLSupported = true; \t} else {    \/\/ Can't get context         isWebGLSupported = false; \t} <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0415\u0441\u043b\u0438 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 WebGL, myYepnope \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b.<\/p>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u0440\u0435\u043b\u043e\u0430\u0434\u0435\u0440. \u0412\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e \u043e\u043d \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u0440\u0430\u0437\u043c\u044b\u0442\u044b\u0439 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0438\u0433\u0440\u044b \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u0435\u043c \u0440\u0430\u0434\u0438\u0443\u0441\u0430 \u0440\u0430\u0437\u043c\u044b\u0442\u0438\u044f \u043f\u043e \u043c\u0435\u0440\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438. <\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/775\/a91\/2ec\/775a912ecf1eb9da9205ec3858640322.png\"\/><\/p>\n<p>  \u042d\u0444\u0444\u0435\u043a\u0442 \u0440\u0430\u0437\u043c\u044b\u0442\u0438\u044f \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u0437\u0430 \u0441\u0447\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f css-\u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430<code> -webkit-filter: blur()<\/code>. \u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u0430\u043d\u0438\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f. \u0414\u043b\u044f Firefox \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f svg filter, \u0440\u0430\u0434\u0438\u0443\u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 css-\u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <code>filter: 'url()'<\/code>, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c <code>data url<\/code> \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u0436\u0434\u044b\u0435 20% \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">if (isWebGLSupported) {     \tvar $body = $('body'),         \t$cc = $('.choose_control'),         \tmaxBlur = 100,         \tsteps = 4,    \t     isWebkitBlurSupported;       \tif ($body[0].style.webkitFilter === undefined) {             isWebkitBlurSupported = false;             $cc.css({filter: &quot;url('data:image\/svg+xml;utf8,&lt;svg xmlns=\\&quot;http:\/\/www.w3.org\/2000\/svg\\&quot;&gt;&lt;filter id=\\&quot;blur-overlay\\&quot;&gt;&lt;feGaussianBlur stdDeviation=\\&quot;&quot; + maxBlur + &quot;\\&quot;\/&gt;&lt;\/filter&gt;&lt;\/svg&gt;#blur-overlay')&quot;});     \t} else {             isWebkitBlurSupported = true;             $body[0].style.webkitFilter = 'blur(' + maxBlur + 'px)';     \t}           $('#loader').css({display: 'table'});         $cc.css({display: 'table'});           yepnope.loadCounter = 0;         yepnope.percent = 0;         yepnope.showLoading = function (n) {             yepnope.percent += maxBlur\/steps;             yepnope.loadCounter += 1;         \t  $(&quot;.loader&quot;).animate({minWidth: Math.round(yepnope.percent)+&quot;px&quot;}, {                 duration: 1000,                 progress: function () {                     var current = parseInt($(&quot;.loader&quot;).css(&quot;minWidth&quot;), 10) * 100\/maxBlur;                     $(&quot;title&quot;).html(Math.floor(current) + &quot;% &quot; + &quot;digital trip&quot;);                     if (isWebkitBlurSupported) {                         $body[0].style.webkitFilter = 'blur('+ (maxBlur - current)+ 'px)';                     }                     if (!isWebkitBlurSupported && current % 20 === 0) {                         $cc.css({filter: &quot;url('data:image\/svg+xml;utf8,&lt;svg xmlns=\\&quot;http:\/\/www.w3.org\/2000\/svg\\&quot;&gt;&lt;filter id=\\&quot;blur-overlay\\&quot;&gt;&lt;feGaussianBlur stdDeviation=\\&quot;&quot; + (maxBlur - maxBlur\/(steps+1)*n) + &quot;\\&quot;\/&gt;&lt;\/filter&gt;&lt;\/svg&gt;#blur-overlay')&quot;});                     }                     if (current === 100) {                         $(&quot;title&quot;).html(&quot;digital trip&quot;);                         if (!isWebkitBlurSupported && current % 20 === 0) $cc.css({filter: &quot;url('data:image\/svg+xml;utf8,&lt;svg xmlns=\\&quot;http:\/\/www.w3.org\/2000\/svg\\&quot;&gt;&lt;filter id=\\&quot;blur-overlay\\&quot;&gt;&lt;feGaussianBlur stdDeviation=\\&quot;&quot; + 0 + &quot;\\&quot;\/&gt;&lt;\/filter&gt;&lt;\/svg&gt;#blur-overlay')&quot;});                     }             \t},                 complete: function () {   \t              if (n === steps) {                         DT.runApp();                     }             \t}         \t});     \t};     \tyepnope([{         \tload: [                 &quot;js\/vendor\/three.min.js&quot;,                 &quot;js\/DT.min.js&quot;,   \t          &quot;..\/socket.io\/socket.io.js&quot;         \t],             callback: {}     \t}]); \t} else {         $('#nogame').css({display: 'table'}); \t}  <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u0437 \u0442\u0440\u0435\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u043d\u0430\u0447\u0430\u0442\u044c \u0438\u0433\u0440\u0443.<\/p>\n<h5>\u0421\u043e\u0431\u044b\u0442\u0438\u044f<\/h5>\n<p>  \u0412\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u0438\u0433\u0440\u044b \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u044b \u043d\u0430 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u0445<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u043e\u0431\u044b\u0442\u0438\u044f<\/b><\/p>\n<div class=\"spoiler_text\">&#8216;blur&#8217; \/\/ \u043f\u043e\u0442\u0435\u0440\u044f \u0444\u043e\u043a\u0443\u0441\u0430<br \/>  &#8216;focus&#8217; \/\/ \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0444\u043e\u043a\u0443\u0441\u0430<br \/>  &#8216;socketInitialized&#8217; \/\/ \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f socket.io<br \/>  &#8216;externalObjectLoaded&#8217; \/\/ \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438<\/p>\n<p>  &#8216;startGame&#8217; \/\/ \u0437\u0430\u043f\u0443\u0441\u043a \u0438\u0433\u0440\u044b<br \/>  &#8216;pauseGame&#8217; \/\/ \u043f\u0430\u0443\u0437\u0430<br \/>  &#8216;resumeGame&#8217; \/\/ \u0432\u043e\u0437\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u0433\u0440\u044b<br \/>  &#8216;gameOver&#8217; \/\/ \u043a\u043e\u043d\u0435\u0446 \u0438\u0433\u0440\u044b<br \/>  &#8216;resetGame&#8217; \/\/ \u0441\u0431\u0440\u043e\u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438\u0433\u0440\u044b<\/p>\n<p>  &#8216;updatePath&#8217; \/\/ \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0438\u0433\u0440\u043e\u0432\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0435 (\u0442\u0440\u0443\u0431\u0435)<br \/>  &#8216;update&#8217; \/\/ \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0438\u0433\u0440\u044b<\/p>\n<p>  &#8216;changeSpeed&#8217; \/\/ \u0432\u043d\u0435\u0448\u043d\u0435\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 <br \/>  &#8216;showHelth&#8217; \/\/ \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0437\u0434\u043e\u0440\u043e\u0432\u044c\u044f<br \/>  &#8216;showInvulner&#8217; \/\/ \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043d\u0435\u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438 (\u0449\u0438\u0442)<br \/>  &#8216;showScore&#8217; \/\/ \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043e\u0447\u043a\u043e\u0432<br \/>  &#8216;showFun&#8217; \/\/ \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0440\u0435\u0436\u0438\u043c\u0430 \u0437\u0430\u043c\u0435\u0434\u043b\u0435\u043d\u0438\u044f (\u043a\u043e\u0442\u0438\u043a\u0430)<br \/>  &#8216;changeHelth&#8217; \/\/ \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0437\u0434\u043e\u0440\u043e\u0432\u044c\u044f<br \/>  &#8216;bump&#8217; \/\/ \u0441\u0442\u043e\u043b\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u0435 \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c<br \/>  &#8216;blink&#8217; \/\/ \u043c\u0438\u0433\u0430\u043d\u0438\u0435 \u0441\u0444\u0435\u0440\u044b<br \/>  &#8216;hit&#8217; \/\/ \u0441\u0442\u043e\u043b\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u0435 \u0441 \u043a\u0430\u043c\u043d\u0435\u043c<br \/>  &#8216;changeScore&#8217; \/\/ \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043e\u0447\u043a\u043e\u043c<br \/>  &#8216;catchBonus&#8217; \/\/ \u043f\u043e\u0438\u043c\u043a\u0430 \u0431\u043e\u043d\u0443\u0441\u0430<br \/>  &#8216;makeInvulner&#8217; \/\/ \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0440\u0435\u0436\u0438\u043c\u0430 \u043d\u0435\u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438 (\u0449\u0438\u0442\u0430)<br \/>  &#8216;makeFun&#8217; \/\/ \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0440\u0435\u0436\u0438\u043c\u0430 \u0437\u0430\u043c\u0435\u0434\u043b\u0435\u043d\u0438\u044f (\u043a\u043e\u0442\u0438\u043a\u0430)<br \/>  &#8216;showBonuses&#8217; \/\/ \u043e\u0431\u043e\u0442\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u0439\u043c\u0430\u043d\u043d\u044b\u0445 \u0431\u043e\u043d\u0443\u0441\u043e\u0432<br \/>  &#8216;stopFun&#8217; \/\/ \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0440\u0435\u0436\u0438\u043c\u0430 \u043a\u043e\u0442\u0438\u043a\u0430<\/p>\n<p>  &#8216;paymentCheck&#8217; \/\/ \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0434\u043b\u044f \u043e\u043f\u043b\u0430\u0442\u044b<br \/>  &#8216;paymentMessage&#8217; \/\/ \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e \u043f\u043b\u0430\u0442\u0435\u0436\u0435<br \/>  &#8216;transactionMessage&#8217; \/\/ \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438<br \/>  &#8216;checkup&#8217; \/\/ \u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438  <\/div>\n<\/div>\n<p>  \u0421\u043e\u0431\u044b\u0442\u0438\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u0432 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0435 <code>document<\/code>, \u0432\u044b\u0437\u044b\u0432\u0430\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">DT.$document.trigger('gameOver', {cause: 'death'}); DT.$document.on('gameOver', function (e, data) {     \tif (data.cause === 'death') {             DT.audio.sounds.gameover.play();     \t} \t}); <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0421\u043e\u0431\u044b\u0442\u0438\u044f <code>'blur'<\/code> \u0438 <code>'focus'<\/code> \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 <code>window<\/code> \u0438 \u0441\u043b\u0443\u0436\u0430\u0442 \u0434\u043b\u044f \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0437\u0432\u0443\u043a\u0430 \u0438 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u0443\u0437\u044b \u043f\u0440\u0438 \u043f\u043e\u0442\u0435\u0440\u0435 \u0444\u043e\u043a\u0443\u0441\u0430 \u043e\u043a\u043d\u0430 \u0441 \u0438\u0433\u0440\u043e\u0439.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">DT.$window.on('blur', function() {     \tif (DT.game.wasStarted && !DT.game.wasPaused && !DT.game.wasOver) {             DT.$document.trigger('pauseGame', {});     \t}         DT.setVolume(0); \t}); <\/code><\/pre>\n<\/div>\n<\/div>\n<h5>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043c\u0438\u0440\u0430<br \/>  <\/h5>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0432\u0441\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043d\u0430 <code>three.js<\/code>: \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u0446\u0435\u043d\u0430, \u043a\u0430\u043c\u0435\u0440\u0430, \u0438\u0433\u0440\u043e\u0432\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e, \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438 \u0441\u0432\u0435\u0442\u0430, \u0444\u043e\u043d.<\/p>\n<h6>\u0421\u0446\u0435\u043d\u0430<\/h6>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">DT.scene = new THREE.Scene(); <\/code><\/pre>\n<\/div>\n<\/div>\n<h6>\u041a\u0430\u043c\u0435\u0440\u0430<\/h6>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">DT.splineCamera = new THREE.PerspectiveCamera( 84, window.innerWidth \/ window.innerHeight, 0.01, 1000 ); <\/code><\/pre>\n<\/div>\n<\/div>\n<h6>\u0418\u0433\u0440\u043e\u0432\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u2014 \u0442\u0440\u0443\u0431\u0430, \u0432\u0434\u043e\u043b\u044c \u043a\u0440\u0438\u0432\u043e\u0439 TorusKnot \u0438\u0437 \u043d\u0430\u0431\u043e\u0440\u0430 THREE.Curves<\/h6>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">var extrudePath = new THREE.Curves.TorusKnot(); DT.tube = new THREE.TubeGeometry(extrudePath, 100, 3, 8, true, true); <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438 \u0441\u0432\u0435\u0442\u0430  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">DT.lights = {     \tlight: new THREE.PointLight(0xffffff, 0.75, 100),         directionalLight: new THREE.DirectionalLight(0xffffff, 0.5) \t}; <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0424\u043e\u043d \u0432 \u0432\u0438\u0434\u0435 \u0441\u0444\u0435\u0440\u044b \u0432\u043e\u043a\u0440\u0443\u0433 \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0441 \u043d\u0430\u0442\u044f\u043d\u0443\u0442\u043e\u0439 \u043f\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u0438 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u043e\u0439 \u0441 \u0433\u0440\u0430\u043d\u0438\u0446\u0430\u043c\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0446\u0432\u0435\u0442\u0430 \u0434\u043b\u044f \u0431\u0435\u0441\u0448\u043e\u0432\u043d\u043e\u0433\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">var geomBG = new THREE.SphereGeometry(500, 32, 32), \tmatBG = new THREE.MeshBasicMaterial({         \tmap: THREE.ImageUtils.loadTexture('img\/background5.jpg'),     \t}); var worldBG = new THREE.Mesh(geomBG, matBG);     worldBG.material.side = THREE.BackSide; <\/code><\/pre>\n<\/div>\n<\/div>\n<h5>\u041a\u043b\u0430\u0441\u0441\u044b<\/h5>\n<p>  \u0412 \u0438\u0433\u0440\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432: \u0418\u0433\u0440\u0430 (<code>DT.Game<\/code>), \u0418\u0433\u0440\u043e\u043a (<code>DT.Player<\/code>) \u0438 \u0418\u0433\u0440\u043e\u0432\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 (<code>DT.GameObject<\/code>). \u041e\u043d\u0438 \u0438\u043c\u0435\u044e\u0442 \u0441\u0432\u043e\u0438 \u043c\u0435\u0442\u043e\u0434\u044b (\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f, \u0441\u0431\u0440\u043e\u0441\u0430 \u0438 \u043f\u0440.), \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438 \u0432 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0442\u043e\u0433\u043e \u0438\u043b\u0438 \u0438\u043d\u043e\u0433\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f. \u041e\u0431\u044a\u0435\u043a\u0442 \u0438\u0433\u0440\u044b \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b (\u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c, \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435), \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b (\u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u043a\u0430\u043c\u043d\u044f\u043c\u0438 \u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0441\u0432\u043e\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 (<code>wasStarted<\/code>, <code>wasPaused<\/code>). \u041e\u0431\u044a\u0435\u043a\u0442 \u0438\u0433\u0440\u043e\u043a\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u0438\u0433\u0440\u043e\u043a\u0430 (\u0441\u0447\u0435\u0442, \u0436\u0438\u0437\u043d\u0438, \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043d\u0435\u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438), \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438\u0433\u0440\u043e\u043a\u0430 (\u0441\u0444\u0435\u0440\u0430, \u043a\u043e\u043b\u044c\u0446\u0430 (\u043a\u043e\u043d\u0442\u0443\u0440\u044b, \u044f\u0432\u043b\u044f\u044e\u0449\u0438\u0435\u0441\u044f \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u0430\u043c\u0438 \u0437\u0434\u043e\u0440\u043e\u0432\u044c\u044f) \u0432\u043e\u043a\u0440\u0443\u0433 \u0441\u0444\u0435\u0440\u044b). \u0412\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u043e\u0434\u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438 \u0418\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 (\u0447\u0430\u0441\u0442\u0438\u0446\u044b, \u0449\u0438\u0442 \u043d\u0430 \u0438\u0433\u0440\u043e\u043a\u0435, \u0431\u043e\u043d\u0443\u0441\u044b).<\/p>\n<h5>\u0412\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u0438 \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438<\/h5>\n<p>  \u0412 \u0438\u0433\u0440\u0435 \u0435\u0441\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u0432\u0443\u0445 \u0442\u0438\u043f\u043e\u0432: \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 (\u043f\u0440\u043e\u0441\u0442\u044b\u0435) \u043c\u043e\u0434\u0435\u043b\u0438 (\u0441\u0444\u0435\u0440\u0430, \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440 \u0437\u0434\u043e\u0440\u043e\u0432\u044c\u044f (\u043a\u043e\u043b\u044c\u0446\u0430\/\u043a\u043e\u043d\u0442\u0443\u0440\u044b), \u043a\u0430\u043c\u043d\u0438 \u0438 \u043c\u043e\u043d\u0435\u0442\u044b), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 three.js \u0438 \u0432\u043d\u0435\u0448\u043d\u0438\u0435 (\u0441\u043b\u043e\u0436\u043d\u044b\u0435) \u043c\u043e\u0434\u0435\u043b\u0438 (\u0431\u043e\u043d\u0443\u0441\u044b \u0438 HTML5 \u0449\u0438\u0442 \u0432\u043e\u043a\u0440\u0443\u0433 \u0441\u0444\u0435\u0440\u044b) \u043f\u043e\u0434\u0433\u0440\u0443\u0436\u0430\u044e\u0442\u0441\u044f \u0432 .obj \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c <a href=\"https:\/\/github.com\/mrdoob\/three.js\/blob\/master\/examples%2Fwebgl_loader_obj.html\">\u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u043e\u043c<\/a>.<br \/>  \u0421\u0444\u0435\u0440\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0438\u0433\u0440\u043e\u043a\u0430 \u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 2 \u043e\u0431\u044a\u0435\u043a\u0442\u0430: \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u0444\u0435\u0440\u0430 \u0434\u043b\u044f \u0440\u0430\u0441\u0447\u0435\u0442\u043e\u0432 \u0441\u0442\u043e\u043b\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u0439 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c (\u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u043d\u0430 \u0441\u0446\u0435\u043d\u0443)<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">this.sphere = new THREE.Mesh(new THREE.SphereGeometry(0.5, 32, 32), new THREE.MeshPhongMaterial({})); <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0447\u0430\u0441\u0442\u0438\u0446 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0434\u0432\u0438\u0436\u043a\u0430 \u0434\u043b\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0447\u0430\u0441\u0442\u0438\u0446 <a href=\"http:\/\/jeromeetienne.github.io\/fireworks.js\/\">Fireworks<\/a>.<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/68a\/ef2\/329\/68aef23293410c5fc843d8300792f80e.png\"\/><\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">this.emitter = Fireworks.createEmitter({nParticles : 100})         .effectsStackBuilder()             .spawnerSteadyRate(30)             .position(Fireworks.createShapePoint(0, 0, 0))             .velocity(Fireworks.createShapePoint(0, 0, 0))             .lifeTime(0.2, 0.7)             .renderToThreejsParticleSystem({ ... })         \t.back()     \t.start(); <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u041c\u043e\u0434\u0435\u043b\u0438 \u0431\u043e\u043d\u0443\u0441\u043e\u0432 \u043f\u043e\u0434\u0433\u0440\u0443\u0436\u0430\u044e\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 2 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043a\u0430\u0436\u0434\u0430\u044f \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0432\u0435\u0440\u0448\u0438\u043d (\u0442\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438).<\/p>\n<h6>\u0421\u043f\u0438\u0441\u043e\u043a \u043c\u043e\u0434\u0435\u043b\u0435\u0439<\/h6>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">DT.listOfModels = [{         \tname: 'bonusH1',         \tscale: 0.1,             rotaion: new THREE.Vector3(0, 0, 0),         \tcolor: 0xff0000,     \t}, {         \tname: 'bonusI',         \tscale: 0.02,             rotaion: new THREE.Vector3(0, 0, 0),         \tcolor: 0x606060,         \t'5': 0xffffff,         \t'html': 0xffffff,             'orange': 0xD0671F,             'shield': 0xC35020,     \t}, {         \tname: 'bonusE1',         \tscale: 0.75,             rotaion: new THREE.Vector3(0, 0, 0),         \tcolor: 0x606060,     \t}, {         \tname: 'bonusH2',         \tscale: 0.1,             rotaion: new THREE.Vector3(0, 0, 0),         \tcolor: 0xff0000,     \t}, {         \tname: 'shield',         \tscale: 0.16,             rotaion: new THREE.Vector3(0, 0, 0),         \tcolor: 0x606060,     \t}, {         \tname: 'bonusE2',         \tscale: 0.75, \t        rotaion: new THREE.Vector3(0, 0, 0),         \tcolor: 0x606060,     \t} \t]; <\/code><\/pre>\n<\/div>\n<\/div>\n<h6>\u0417\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a<\/h6>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">var manager = new THREE.LoadingManager();       manager.onProgress = function (item, loaded, total) {         console.info('loaded item', loaded, 'of', total, '('+item+')'); \t}; \t \tvar loader = new THREE.OBJLoader(manager);       DT.listOfModels.forEach(function (el, i, a) {         loader.load('objects\/' + el.name + '.obj', function ( object ) {             object.traverse( function ( child ) {             \tvar color = el[child.name] || el.color;                 child.material = new THREE.MeshPhongMaterial({                     color: color,                     shading: THREE.SmoothShading,                     emissive: new THREE.Color(color).multiplyScalar(0.5),                     shininess: 100,             \t}); \t        });         \tif (i === 1) {                 a[i].object = object         \t} else {                 a[i].object = object.children[0];         \t}             DT.$document.trigger('externalObjectLoaded', {index: i});     \t}); \t});  <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c\u0438 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 <code>DT.listOfModels[index].object<\/code> \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u0431\u043e\u043d\u0443\u0441\u0430.<\/p>\n<h5>\u041f\u0440\u0435\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f (\u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438) \u0438 \u043f\u043e\u0441\u0442\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0438\u043d\u0433<\/h5>\n<p>  \u0412 \u0438\u0433\u0440\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0439: \u0434\u043b\u044f \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432 \u0437\u0434\u043e\u0440\u043e\u0432\u044c\u044f, \u0434\u043b\u044f \u0431\u043e\u043d\u0443\u0441\u043e\u0432 \u0438 glitch-\u044d\u0444\u0444\u0435\u043a\u0442 (\u0438\u043b\u0438 \u044d\u0444\u0444\u0435\u043a\u0442 \u0441\u043b\u043e\u043c\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u043b\u0435\u0432\u0438\u0437\u043e\u0440\u0430) \u0432 \u043a\u043e\u043d\u0446\u0435 \u0438\u0433\u0440\u044b.<\/p>\n<p>  \u0422\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0437\u0434\u043e\u0440\u043e\u0432\u044c\u044f \u0438 \u0431\u043e\u043d\u0443\u0441\u043e\u0432 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u044b \u043d\u0430 <a href=\"http:\/\/threejs.org\/examples\/webgl_morphtargets_horse.html\">morphTargets<\/a>. <br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/0c5\/174\/380\/0c5174380ad5941a4487e94f0548c560.png\"\/><\/p>\n<p>  \u041f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430. \u041e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0435 \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0438 <code>morphTargets<\/code>. \u0422\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u0440\u043e\u0432\u043d\u0435\u043c <code>morphTargetInfluences<\/code> \u043e\u0431\u044a\u0435\u043a\u0442\u0430.<\/p>\n<p>  \u0418\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440 \u0437\u0434\u043e\u0440\u043e\u0432\u044c\u044f (\u043a\u043e\u043b\u044c\u0446\u0430\/\u043a\u043e\u043d\u0442\u0443\u0440\u044b) \u0432\u043e\u043a\u0440\u0443\u0433 \u0441\u0444\u0435\u0440\u044b \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f 2 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438, \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0445 180 \u0432\u0435\u0440\u0448\u0438\u043d (\u043f\u043e 60 \u0441 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u0438 \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b). <\/p>\n<p>  \u041a\u043e\u043b\u044c\u0446\u0430\/\u043a\u043e\u043d\u0442\u0443\u0440\u044b \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u043e\u0431\u043e\u0439 \u043e\u043a\u0440\u0443\u0436\u043d\u043e\u0441\u0442\u0438, \u043f\u044f\u0442\u0438-, \u0447\u0435\u0442\u044b\u0440\u0435\u0445- \u0438 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0438, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0435\u0440\u0448\u0438\u043d \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f 180.<br \/>  \u0412\u0430\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0447\u0438\u0441\u043b\u043e \u0432\u0435\u0440\u0448\u0438\u043d \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u0431\u044b\u043b\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c, \u0430 \u0438\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u043c\u0435\u043d\u044f\u043b\u0438\u0441\u044c \u00ab\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u00bb (\u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0436\u0435\u043b\u0430\u0435\u043c\u043e\u0439 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439), \u0438\u043d\u0430\u0447\u0435 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0438\u043b\u0438 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432\u043e\u0432\u0441\u0435.<\/p>\n<p>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0431\u044b\u043b\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0438 \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0437\u0434\u043e\u0440\u043e\u0432\u044c\u044f (\u043a\u043e\u043b\u0435\u0446\/\u043a\u043e\u043d\u0442\u0443\u0440\u043e\u0432). <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">DT.createGeometry = function (circumradius) {     \tvar geometry = new THREE.Geometry(),         \tx,             innerradius = circumradius * 0.97,         \tn = 60;       \tfunction setMainVert (rad, numb) {         \tvar vert = [];         \tfor (var i = 0; i &lt; numb; i++) {             \tvar vec3 = new THREE.Vector3(                     rad * Math.sin((Math.PI \/ numb) + (i * ((2 * Math.PI)\/ numb))),                     rad * Math.cos((Math.PI \/ numb) + (i * ((2 * Math.PI)\/ numb))),                     0             \t);                 vert.push(vec3);         \t}         \treturn vert;     \t}       \tfunction fillVert (vert) {         \tvar nFilled, nUnfilled, result = [];           \tnFilled = vert.length;             nUnfilled = n\/nFilled;             vert.forEach(function (el, i, arr) {             \tvar nextInd = i === arr.length - 1 ? 0 : i + 1;             \tvar vec = el.clone().sub(arr[nextInd]);             \tfor (var j = 0; j &lt; nUnfilled; j++) {                     result.push(vec.clone().multiplyScalar(1\/nUnfilled).add(el));             \t}         \t});         \treturn result;     \t}       \t\/\/ set morph targets     \t[60, 5, 4, 3, 2].forEach(function (el, i, arr) {         \tvar vert,                 vertOuter,                 vertInner;           \tvertOuter = fillVert(setMainVert(circumradius, el).slice(0)).slice(0);             vertInner = fillVert(setMainVert(innerradius, el).slice(0)).slice(0);           \tvert = vertOuter.concat(vertInner);               geometry.morphTargets.push({name: 'vert'+i, vertices: vert});           \tif (i === 0) {                 geometry.vertices = vert.slice(0);         \t}     \t});     \t     \t\/\/ Generate the faces of the n-gon.     \tfor (x = 0; x &lt; n; x++) {         \tvar next = x === n - 1 ? 0 : x + 1;         \tgeometry.faces.push(new THREE.Face3(x, next, x + n));             geometry.faces.push(new THREE.Face3(x + n, next, next + n));     \t}       \treturn geometry; \t}; <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u041f\u043e \u044d\u0442\u043e\u0439 \u0436\u0435 \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0431\u043e\u043d\u0443\u0441\u043e\u0432 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 \u0434\u0432\u0443\u0445 .obj \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043d\u044b\u0445 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 (\u043a\u0430\u043a \u044d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043b\u044f \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e\u0439 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f (\u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438). \u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e 3ds Max \u0438 blender.<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/a7a\/a11\/f73\/a7aa11f73fa6a75f9836f80df36d0ed1.png\"\/><\/p>\n<p>  \u0421 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u0433\u0443\u0431 \u0435\u0441\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442. \u0412 \u043e\u0431\u044b\u0447\u043d\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u0433\u0443\u0431\u044b \u0430\u043d\u0438\u043c\u0438\u0440\u0443\u044e\u0442\u0441\u044f (\u043f\u0440\u0438\u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0438 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u044e\u0442\u0441\u044f). \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u0438\u043b\u044b \u0432\u043b\u0438\u044f\u043d\u0438\u044f \u0432\u0435\u0440\u0448\u0438\u043d \u0438\u0437 \u0434\u0432\u0443\u0445 \u043d\u0430\u0431\u043e\u0440\u043e\u0432 \u0432\u0435\u0440\u0448\u0438\u043d (\u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u044b\u0445 \u0433\u0443\u0431). \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e <a href=\"https:\/\/github.com\/mrdoob\/three.js\/blob\/master\/src\/objects\/MorphAnimMesh.js\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 three.js<\/a>, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>morphTargetInfluence<\/code> \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u0432\u0435\u0440\u0448\u0438\u043d \u0434\u043e\u043b\u0436\u043d\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435 [0, 1]. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u0438\u043b\u044b \u0431\u043e\u043b\u044c\u0448\u0435 1 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u044d\u0444\u0444\u0435\u043a\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u00ab\u0433\u0438\u043f\u0435\u0440\u0432\u043b\u0438\u044f\u043d\u0438\u044f\u00bb. \u0422\u0430\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c morphTargetInfluence \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c 5 \u043a \u043d\u0430\u0431\u043e\u0440\u0443 \u0432\u0435\u0440\u0448\u0438\u043d \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u043a\u043e\u0442\u0430, \u043c\u043e\u0434\u0435\u043b\u044c \u043a\u0430\u043a \u0431\u0443\u0434\u0442\u043e \u00ab\u0432\u044b\u0432\u0435\u0440\u043d\u0435\u0442\u0441\u044f \u043d\u0430\u0438\u0437\u043d\u0430\u043d\u043a\u0443\u00bb. \u0423 \u043c\u043e\u0434\u0435\u043b\u0438 \u0433\u0443\u0431 \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u0430\u043a \u00ab\u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0435 \u0440\u0442\u0430\u00bb. <br \/>  \u041d\u0430 \u044d\u0442\u043e\u043c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u044d\u0444\u0444\u0435\u043a\u0442 \u043f\u043e\u0433\u043b\u043e\u0449\u0435\u043d\u0438\u044f \u0431\u043e\u043d\u0443\u0441\u0430 \u00ab\u0433\u0443\u0431\u044b\u00bb, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438.<br \/>  Glitch-\u044d\u0444\u0444\u0435\u043a\u0442 (\u0438\u043b\u0438 \u044d\u0444\u0444\u0435\u043a\u0442 \u0441\u043b\u043e\u043c\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u043b\u0435\u0432\u0438\u0437\u043e\u0440\u0430), \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0434\u043b\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0446\u0430 \u0438\u0433\u0440\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u0441\u0442\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0438\u043d\u0433\u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c <a href=\"http:\/\/www.airtightinteractive.com\/demos\/js\/badtvshader\/\">\u0448\u0435\u0439\u0434\u0435\u0440\u043e\u0432<\/a>.<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/c3a\/d28\/266\/c3ad282665fdae4eeaed4e5fce021f21.png\"\/><\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u044d\u0444\u0444\u0435\u043a\u0442  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">DT.effectComposer = new THREE.EffectComposer( DT.renderer );     DT.effectComposer.addPass( new THREE.RenderPass( DT.scene, DT.splineCamera ) );     DT.effectComposer.on = false;      var badTVParams = {         mute:true,         show: true,         distortion: 3.0,         distortion2: 1.0,         speed: 0.3,         rollSpeed: 0.1     }          var badTVPass = new THREE.ShaderPass( THREE.BadTVShader );     badTVPass.on = false;     badTVPass.renderToScreen = true;     DT.effectComposer.addPass(badTVPass); <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0418 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043c \u0435\u0433\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u043a\u0430\u0434\u0440  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\"> DT.$document.on('update', function (e, data) {         if (DT.effectComposer.on) {             badTVPass.uniforms[ &quot;distortion&quot; ].value = badTVParams.distortion;             badTVPass.uniforms[ &quot;distortion2&quot; ].value = badTVParams.distortion2;             badTVPass.uniforms[ &quot;speed&quot; ].value = badTVParams.speed;             badTVPass.uniforms[ &quot;rollSpeed&quot; ].value = badTVParams.rollSpeed;             DT.effectComposer.render();                 badTVParams.distortion+=0.15;                 badTVParams.distortion2+=0.05;                 badTVParams.speed+=0.015;                 badTVParams.rollSpeed+=0.005;         };     }); <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u042d\u0444\u0444\u0435\u043a\u0442 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u044f <code>\u2018gameOver\u2019<\/code>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\"> DT.$document.on('gameOver', function (e, data) {         DT.effectComposer.on = true;     }); <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0418 \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u0438  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\"> DT.$document.on('resetGame', function (e, data) {         DT.effectComposer.on = false;         badTVParams = {             distortion: 3.0,             distortion2: 1.0,             speed: 0.3,             rollSpeed: 0.1         }     }); <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u0441\u0442\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0438\u043d\u0433\u0430 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u0440\u0435\u043c\u044f \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u043a\u0430\u0434\u0440\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0441\u0442\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0438\u043d\u0433 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0435\u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0438 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0438\u0433\u0440\u044b.<\/p>\n<h5>\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u0443\u0437\u044b\u043a\u0438<\/h5>\n<p>  \u041c\u0443\u0437\u044b\u043a\u0430 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0443\u043b\u044c\u0441\u0430\u0446\u0438\u0435\u0439 \u0447\u0430\u0441\u0442\u0438\u0446 (\u043f\u044b\u043b\u0438), \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0445\u0441\u044f \u0432 \u0438\u0433\u0440\u043e\u0432\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435. <\/p>\n<p>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0431\u044b\u043b\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0430 \u0436\u0435\u043b\u0430\u0435\u043c\u0430\u044f \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u0423\u0440\u043e\u0432\u0435\u043d\u044c \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u0437\u0432\u0443\u043a\u0430 \u043d\u0443\u0436\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u043e\u0442\u044b (<code>DT.audio.valueAudio<\/code>) \u0432 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432 \u0431\u0443\u0444\u0435\u0440\u0435 \u0434\u043b\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0430\u043a  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">var getFrequencyValue = function(frequency, bufferIndex) {         \tif (!DT.isAudioCtxSupp) return;         \tvar nyquist = DT.audio.context.sampleRate\/2,                 index = Math.round(frequency\/nyquist * freqDomain[bufferIndex].length);         \treturn freqDomain[bufferIndex][index];     \t};   var visualize = function(index) {         \tif (!DT.isAudioCtxSupp) return;             freqDomain[index] = new Uint8Array(analysers[index].frequencyBinCount);             analysers[index].getByteFrequencyData(freqDomain[index]);             DT.audio.valueAudio = getFrequencyValue(DT.audio.frequency[index], index);     \t}; <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>DT.audio.valueAudio<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u0438 \u0447\u0430\u0441\u0442\u0438\u0446:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">DT.$document.on('update', function (e, data) {         DT.dust.updateMaterial({             isFun: DT.player.isFun,             valueAudio: DT.audio.valueAudio,             color: DT.player.sphere.material.color         });     }); <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0421\u0430\u043c \u043c\u0435\u0442\u043e\u0434 <code>updateMaterial<\/code>:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">DT.Dust.prototype.updateMaterial = function (options) {         if (!this.material.visible) {             this.material.visible = true;         }         this.material.color = options.isFun ? options.color : new THREE.Color().setRGB(1,0,0);         this.material.opacity = 0.5 + options.valueAudio\/255;         return this;     }; <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e WebAudio API \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"http:\/\/html5.by\/blog\/audio\/\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<h5>\u0410\u043d\u0438\u043c\u0430\u0446\u0438\u044f favicon<\/h5>\n<p>  Favicon \u0432 digital trip \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0447\u0435\u0440\u043d\u043e-\u0431\u0435\u043b\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u0430. <br \/>  \u0412 \u0440\u0435\u0436\u0438\u043c\u0435 \u0437\u0430\u043c\u0435\u0434\u043b\u0435\u043d\u0438\u044f (\u0440\u0435\u0436\u0438\u043c \u043a\u043e\u0442\u0438\u043a\u0430) \u0438\u043a\u043e\u043d\u043a\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043c\u0435\u043d\u044f\u0442\u044c \u0446\u0432\u0435\u0442.<br \/>  \u0415\u0441\u043b\u0438 \u0432 Firefox \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c  <\/p>\n<pre><code class=\"html\">&lt;link rel=&quot;icon&quot; type=&quot;image\/gif&quot; href=&quot;fav.gif&quot;&gt; <\/code><\/pre>\n<p>  \u0442\u043e \u0432 Chrome \u0442\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0435 \u043f\u0440\u043e\u0439\u0434\u0435\u0442. \u0414\u043b\u044f Chrome \u0431\u044b\u043b\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043f\u043e\u0434\u043c\u0435\u043d\u0430 png-\u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f favicon.<br \/>  \u041e\u0431\u0449\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">var favicon = document.getElementsByTagName('link')[1],     \tgiffav = document.createElement('link'),     \thead = document.getElementsByTagName('head')[0],     \tisChrome = navigator.userAgent.indexOf('Chrome') !== -1;       giffav.setAttribute('rel', 'icon');     giffav.setAttribute('type', 'image\/gif');     giffav.setAttribute('href', 'img\/fav.gif');       DT.$document.on('update', function (e, data) {     \tif (isChrome && DT.player.isFun && DT.animate.id % 10 === 0) favicon.setAttribute('href', 'img\/' + (DT.animate.id % 18 + 1) + '.png'); \t});     DT.$document.on('showFun', function (e, data) {     \tif (!data.isFun) {    \t     if (isChrome) {                 favicon.setAttribute('href', 'img\/0.png');         \t} else {                 $(giffav).remove();                 head.appendChild(favicon);         \t}     \t} else {         \tif (!isChrome) {             \t$(favicon).remove();                 head.appendChild(giffav);         \t}     \t} \t}); <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <code>\u2018update\u2019<\/code> \u2013 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, <code>\u2018showFun\u2019<\/code> \u2013 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043e \u043d\u0430\u0447\u0430\u043b\u0435 \u0440\u0435\u0436\u0438\u043c\u0430 \u043a\u043e\u0442\u0438\u043a\u0430 (\u0437\u0430\u043c\u0435\u0434\u043b\u0435\u043d\u0438\u044f), <code>DT.player.isFun<\/code> \u2014 \u0441\u043e\u0442\u043e\u044f\u043d\u0438\u0435 \u0440\u0435\u0436\u0438\u043c\u0430 \u043a\u043e\u0442\u0438\u043a\u0430, <code>DT.animate.id<\/code> \u2013 \u043d\u043e\u043c\u0435\u0440 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0444\u0440\u0435\u0439\u043c\u0430 (\u043a\u0430\u0434\u0440\u0430). \u0412\u0441\u0435\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 favicon \u2014 19. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0432 Safari \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 favicon \u043d\u0435\u0442.<\/p>\n<h4>\u041c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440<\/h4>\n<p>  \u0412 \u0438\u0433\u0440\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e\u043c.<br \/>  \u0414\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u0438\u043b\u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f QR \u043a\u043e\u0434\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f <a href=\"http:\/\/larsjung.de\/qrcode\/\">\u043f\u043b\u0430\u0433\u0438\u043d\u043e\u043c<\/a>.<\/p>\n<p>  \u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0433\u0438\u0440\u043e\u0441\u043a\u043e\u043f\u0430 \u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f <code>\u2018deviceOrientation\u2019<\/code>. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u0433\u0438\u0440\u043e\u0441\u043a\u043e\u043f\u0430 \u0438\u043b\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043d\u0435\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0430\u0436\u0430\u0442\u0438\u0435\u043c \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f.<\/p>\n<p>  Fallback \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">\/\/ Technique from Juriy Zaytsev \t\/\/ http:\/\/thinkweb2.com\/projects\/prototype\/detecting-event-support-without-browser-sniffing\/ \tvar eventSupported = function( eventName ) {     \tvar el = document.createElement(&quot;div&quot;);     \teventName = &quot;on&quot; + eventName;     \tvar isSupported = (eventName in el);     \tif ( !isSupported ) {             el.setAttribute(eventName, &quot;return;&quot;);             isSupported = typeof el[eventName] === &quot;function&quot;;     \t}     \tel = null;     \treturn isSupported; \t}; \t\/\/ device orientation \tfunction orientationTest (event) {     \tif (!turned && event.gamma) turned = true;         window.removeEventListener('deviceorientation', orientationTest, false);         window.removeEventListener('MozOrientation', orientationTest, false); \t}     window.addEventListener('deviceorientation', orientationTest, false);     window.addEventListener('MozOrientation', orientationTest, false);     setTimeout(function () {     \tif (!turned) {             $(&quot;#btnLeft&quot;).on('touchstart',function () {                 socket.emit(&quot;click&quot;, {&quot;click&quot;:&quot;toTheLeft&quot;});         \t});             $(&quot;#btnRight&quot;).on('touchstart',function () {                 socket.emit(&quot;click&quot;, {&quot;click&quot;:&quot;toTheRight&quot;});         \t});             $status.html(&quot;push buttons to control&quot;);     \t} else {             $status.html(&quot;tilt your device to control&quot;);     \t}     \tif (!eventSupported('touchstart')) {             $status.html(&quot;sorry your device not supported&quot;);     \t} \t}, 1000); <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 <code>'deviceOrientation'<\/code> \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0447\u0435\u0440\u0435\u0437 <code>setTimeout<\/code>, \u0430 \u043d\u0435 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e <code>eventSupported<\/code>, \u0442\u0430\u043a \u043a\u0430\u043a \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, HTC One V), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 <code>'deviceOrientation'<\/code> \u043d\u043e\u043c\u0438\u043d\u0430\u043b\u044c\u043d\u043e, \u043d\u043e \u0441\u0430\u043c\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442. \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043c\u044b \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043a\u0430\u043a\u043e\u0433\u043e-\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0436\u0434\u0435\u043c \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u044f (\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0442\u043e\u0447\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c), \u0438 \u0435\u0441\u043b\u0438 \u043e\u043d\u043e \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442, \u0434\u0435\u043b\u0430\u0435\u043c \u0432\u044b\u0432\u043e\u0434, \u0447\u0442\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u0422\u0430\u043a\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0445\u0430\u043a\u043e\u043c.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043e\u0432 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 HTC c Windows Phone) \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 (mobile IE) \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 <code>'touchstart'<\/code>, \u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 <code>\u2018click\u2019<\/code>. \u041c\u044b \u043e\u0442\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u043e\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0442\u0430\u043a\u0438\u0445 \u0434\u0435\u0432\u0430\u0439\u0441\u043e\u0432, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u0440\u0435\u043c\u044f \u043e\u0442\u043a\u043b\u0438\u043a\u0430 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f <code>\u2018click\u2019<\/code> (300 \u043c\u0441) \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c \u0443 <code>'touchstart'<\/code> \u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043e\u0442\u043a\u043b\u0438\u043a\u0430 \u0434\u043b\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u0430\u043a\u0438\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u043d\u0435 \u0443\u0434\u0430\u0435\u0442\u0441\u044f. <\/p>\n<p>  \u041a\u0441\u0442\u0430\u0442\u0438, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 Macbook Pro c HDD \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043d\u043e\u0443\u0442\u0431\u0443\u043a \u0432 \u0442\u0430\u043a\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u043d\u0435\u043c \u0435\u0441\u0442\u044c \u0433\u0438\u0440\u043e\u0441\u043a\u043e\u043f.<\/p>\n<p>  \u0414\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0441 \u041e\u0421 Android 4.0 \u0438 \u0432\u044b\u0448\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0431\u043e\u043d\u0443\u0441 \u2014 \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0439 \u043e\u0442\u043a\u043b\u0438\u043a \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432 \u0432\u0438\u0434\u0435 \u0432\u0438\u0431\u0440\u0430\u0446\u0438\u0438, \u0435\u0441\u043b\u0438 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u0441 \u043a\u0430\u043c\u043d\u0435\u043c (\u0432\u0438\u0431\u0440\u0430\u0446\u0438\u044f 100 \u043c\u0441) \u0438\u043b\u0438 \u043f\u043e\u0434\u043e\u0431\u0440\u0430\u0442\u044c \u043c\u043e\u043d\u0435\u0442\u043a\u0443 (\u0432\u0438\u0431\u0440\u0430\u0446\u0438\u044f 10 \u043c\u0441). \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f Vibration API (\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0431\u0440\u0430\u0443\u0437\u0435\u0440, \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0439 Chrome \u0438\u043b\u0438 Firefox). \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e Vibration API \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"http:\/\/html5.by\/blog\/vibration-api\/\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>  \u041f\u0440\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043d\u0430\u043a\u043b\u043e\u043d\u043e\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0434\u043e\u043b\u0433\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0435 \u043a\u0430\u0441\u0430\u0442\u044c\u0441\u044f \u044d\u043a\u0440\u0430\u043d\u0430, \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u044d\u043a\u0440\u0430\u043d \u0433\u0430\u0441\u043d\u0435\u0442 \u0438 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0442 \u0433\u0438\u0440\u043e\u0441\u043a\u043e\u043f\u0430. \u0414\u043b\u044f \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0431\u044b\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0445\u0430\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0430\u0443\u0434\u0438\u043e\u043f\u0435\u0442\u043b\u044e: 10-\u0441\u0435\u043a\u0443\u043d\u0434\u043d\u044b\u0439 \u0431\u0435\u0437\u0437\u0432\u0443\u0447\u043d\u044b\u0439 \u0442\u0440\u0435\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0446\u0438\u043a\u043b\u0438\u0447\u043d\u043e \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043a\u043d\u043e\u043f\u043e\u043a: \u0441\u0442\u0430\u0440\u0442, \u0440\u0435\u0441\u0442\u0430\u0440\u0442, \u043f\u0430\u0443\u0437\u0430.<\/p>\n<pre><code class=\"html\">&lt;audio id=&quot;audioloop&quot; src=&quot;..\/sounds\/loop.mp3&quot; onended=&quot;this.play();&quot; autobuffer&gt;&lt;\/audio&gt; <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"javascript\">$('#btnSphere').on('touchstart',function () {                 socket.emit('click', {'click':'pause'});                 $('#audioloop').trigger('play');         \t}); <\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445 \u0441 \u041e\u0421 Android \u0430\u0443\u0434\u0438\u043e\u043f\u0435\u0442\u043b\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c 1-\u0441\u0435\u043a\u0443\u043d\u0434\u043d\u043e\u0439, \u0430 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445 \u0441 iOS \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u0434\u043b\u0438\u043d\u043d\u044b\u0439 \u0442\u0440\u0435\u043a. \u0412 iOS \u0431\u0440\u0430\u0443\u0437\u0435\u0440 Safari \u043d\u0435 \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u0435\u0442 \u0442\u0440\u0435\u043a \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0447\u0438\u0441\u043b\u043e \u0446\u0438\u043a\u043b\u043e\u0432 \u2014 \u043e\u043a\u043e\u043b\u043e 100, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u044b\u043b\u0430 \u0432\u044b\u0431\u0440\u0430\u043d\u0430 \u0434\u043b\u0438\u043d\u0430 \u0442\u0440\u0435\u043a\u0430 \u0432 10 \u0441\u0435\u043a\u0443\u043d\u0434.<\/p>\n<h4>\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0435\u0431-\u043a\u0430\u043c\u0435\u0440\u043e\u0439<\/h4>\n<p>  \u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0435\u0431-\u043a\u0430\u043c\u0435\u0440\u043e\u0439 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043e \u043d\u0430 \u043c\u0435\u0442\u043e\u0434\u0435 <code>getUserMedia()<\/code>.<br \/>  \u041c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0432\u0435\u0431-\u043a\u0430\u043c\u0435\u0440\u044b. \u041e\u0434\u0438\u043d \u0438\u0437 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u2014 \u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u043b\u0430\u0432\u0438\u0448, \u043a\u0430\u043a \u0432 \u044d\u0442\u043e\u043c <a href=\"http:\/\/stemkoski.github.io\/Three.js\/Webcam-Motion-Detection-Texture.html\">\u043f\u0440\u0438\u043c\u0435\u0440\u0435<\/a>.<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/230\/a38\/d73\/230a38d73c115c7f0de8e0fd3f3808de.png\"\/> <\/p>\n<p>  \u041e\u0442 \u043d\u0435\u0433\u043e \u043c\u044b \u043e\u0442\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0442\u043e\u0447\u043d\u044b\u043c.<\/p>\n<p>  \u0414\u0440\u0443\u0433\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0433\u043e\u043b \u043d\u0430\u043a\u043b\u043e\u043d\u0430 \u0433\u043e\u043b\u043e\u0432\u044b \u0438 <a href=\"https:\/\/github.com\/auduno\/headtrackr\/\">\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 headtrackr.js<\/a>. \u041e\u043d \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c \u0438 \u043f\u043e\u043c\u043e\u0433\u0430\u043b \u0440\u0430\u0437\u043c\u044f\u0442\u044c \u0448\u0435\u044e \u0438 \u0441\u043d\u044f\u0442\u044c \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435, \u043e\u0434\u043d\u0430\u043a\u043e \u0443\u0433\u043e\u043b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u043b\u0441\u044f \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0432\u0435\u0431-\u043a\u0430\u043c\u0435\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0433\u043e\u043b\u043e\u0432\u044b \u0438 \u0435\u0435 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u044b \u044d\u043a\u0440\u0430\u043d\u0430 (\u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 headtrackr.js). <\/p>\n<p>  \u0422\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u044b \u0438\u043b\u0438 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0438\u0433\u0440\u044b \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u0435\u0431-\u043a\u0430\u043c\u0435\u0440\u043e\u0439 \u0441\u043d\u0438\u0436\u0435\u043d\u0430.<\/p>\n<h4>Back-end<\/h4>\n<p>  \u0421\u0435\u0440\u0432\u0435\u0440 \u0438\u0433\u0440\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 node.js. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u0438 express, socket.io, mongoose, node-dogecoin \u0438 hookshot.<\/p>\n<p>  \u0422\u0443\u0442 \u0432\u0441\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e: socket.io \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442 \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442, express o\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b \u0438 \u0441\u0442\u0430\u0442\u0438\u043a\u0443, \u0430 mongoose \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445. Hookshot \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043d\u0430 VPS.<\/p>\n<pre><code class=\"javascript\">app.use('\/webhook', hookshot('refs\/heads\/master', 'git pull')); <\/code><\/pre>\n<p>  \u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c \u0432 back-end\u2019\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 dogecoin \u0434\u0435\u043c\u043e\u043d\u043e\u043c, \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044b\u043c \u043d\u0430 \u044d\u0442\u043e\u043c \u0436\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0435. \u042d\u0442\u043e \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 dogecoin \u043a\u043e\u0448\u0435\u043b\u0435\u043a, \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043c\u043e\u0434\u0443\u043b\u044f node-dogecoin \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"javascript\">dogecoin.exec('getbalance', function(err, balance) { \tconsole.log(err, balance); }); <\/code><\/pre>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0441\u0435\u0440\u0432\u0435\u0440 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043d\u0430 \u043f\u0440\u0435\u0434\u043c\u0435\u0442 \u043c\u043e\u0448\u0435\u043d\u043d\u0438\u0447\u0435\u0441\u0442\u0432\u0430. \u0417\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u0431\u0440\u0430\u043d\u043d\u043e\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c \u0447\u0438\u0441\u043b\u043e \u043c\u043e\u043d\u0435\u0442 \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0447\u0438\u0441\u043b\u043e\u043c \u043c\u043e\u043d\u0435\u0442, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0431\u0440\u0430\u0442\u044c \u0437\u0430 \u0432\u0440\u0435\u043c\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0435\u0441\u0441\u0438\u0438.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">var checkCoins = function (timeStart, timeEnd, coinsCollect) { \tvar time = (timeEnd - timeStart)\/1000,     \tmaxCoins = calcMaxCoins(time); \t\/\/ if client recieve more coins than it may \treturn coinsCollect &lt;= maxCoins; };   var calcMaxCoins = function (time) { \tvar speedStart = 1\/60,         acceleration = 1\/2500,     \tmaxPath = 0,     \tmaxCoins = 0,     \tt = 0.25, \/\/ coins position in the tube     \tdt = 0.004, \/\/ coins position offset     \tn = 10; \/\/ number of coins in a row   \tmaxPath = (speedStart + acceleration * Math.sqrt(time * 60)) * time;   \tmaxCoins = Math.floor(maxPath \/ (t + dt * (n - 1)) * n)\/10;     console.log('time:' + time, 'maxCoins:' + maxCoins, 'maxPath:' + maxPath); \treturn maxCoins; }; <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0447\u0438\u0441\u043b\u0430 \u043f\u043b\u0430\u0442\u0435\u0436\u0435\u0439 \u0441 \u043e\u0434\u043d\u043e\u0433\u043e IP, c \u043e\u0434\u043d\u0438\u043c UID (cookie) \u0438 \u0432\u0440\u0435\u043c\u044f \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u043c\u0438 \u0438\u0433\u0440\u0430\u043c\u0438 \u0441 \u043e\u0434\u043d\u043e\u0433\u043e IP. <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">var checkClient = function (clients, currentClient) {     console.log(&quot;Handle clients from Array[&quot; + clients.length + &quot;]&quot;)     var IPpaymentsCounter = 0,         UIDpaymentsCounter = 0,         IPtimeCounter = 60 * 1000,         checkup = null;      clients.forEach(function(client, i) {         if (client.clientIp === currentClient.clientIp && client.paymentRequest) {             IPpaymentsCounter += client.paymentRequest;              if (currentClient.timeEnd && currentClient.cientId !== client.cientId) {                 Math.min(IPtimeCounter, currentClient.timeEnd - client.timeEnd);             }         }         if (client.cookieUID === currentClient.cookieUID && client.paymentRequest) {             UIDpaymentsCounter += client.paymentRequest;         }         \/\/ console.log(&quot;handle client #&quot; + i);     });     console.log('IPtimeCounter', IPtimeCounter);     if (currentClient.checkup === false ||         currentClient.maxCoinsCheck === false ||         IPpaymentsCounter &gt; 1000 ||         UIDpaymentsCounter &gt; 100 ||         IPtimeCounter &lt; 20 * 1000) {         checkup = false;     } else {         checkup = true;     }     return checkup; }; <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u042d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0437\u0430\u0449\u0438\u0442\u0430, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043d\u0430 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u0446\u0435\u043b\u0435\u0441\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e\u0441\u0442\u0438.<\/p>\n<h4>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0438\u043b \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u044d\u0442\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439.<\/p>\n<p>  \u0412\u0441\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0432\u0435\u043b\u0430\u0441\u044c \u043d\u0430 GitHub, \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/github.com\/htdt\/digital_trip\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>  \u0421\u0441\u044b\u043b\u043a\u0438: <a href=\"https:\/\/github.com\/htdt\/digital_trip\">\u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 github<\/a>, \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438\u0433\u0440\u044b (\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0438\u0433\u0440\u0443 \u0432 \u043f\u043e\u0440\u0442\u0444\u043e\u043b\u0438\u043e), <a href=\"http:\/\/dt.htdt.ru\/\">\u0438\u0433\u0440\u0430<\/a><\/p>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438:  <\/p>\n<ul>\n<li><a href=\"http:\/\/jquery.com\/\">jQuery<\/a> <\/li>\n<li>\n<ul>\n<li><a href=\"http:\/\/larsjung.de\/qrcode\/\">jquery.qrcode<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"http:\/\/threejs.org\/\">three.js<\/a> <\/li>\n<li>\n<ul>\n<li>Detector<\/li>\n<li> CurveExtras<\/li>\n<li> OBJLoader<\/li>\n<li> Stats<\/li>\n<\/ul>\n<\/li>\n<li> \u2014 <a href=\"http:\/\/www.threejsgames.com\/extensions\/\">threex<\/a> (\u043d\u0430\u0431\u043e\u0440 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432) <\/li>\n<li><a href=\"https:\/\/github.com\/auduno\/headtrackr\/\">headtrackr.js<\/a> <\/li>\n<li><a href=\"http:\/\/yepnopejs.com\/\">yepnope.js<\/a> <\/li>\n<li><a href=\"http:\/\/socket.io\/\">socket.io<\/a> <\/li>\n<li><a href=\"http:\/\/jeromeetienne.github.io\/fireworks.js\/\">fireworks<\/a> (\u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0447\u0430\u0441\u0442\u0438\u0446) <\/li>\n<li> \u2014 <a href=\"http:\/\/www.html5rocks.com\/en\/tutorials\/webaudio\/intro\/#toc-abstract\">Web Audio BufferLoader<\/a><\/li>\n<\/ul>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/company\/htdt\/blog\/230323\/\"> http:\/\/habrahabr.ru\/company\/htdt\/blog\/230323\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">     \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/97a\/1a1\/f98\/97a1a1f980258da970bd8575c509cfd5.png\" alt=\"image\"\/><\/p>\n<p>  \u041f\u0440\u0438\u0432\u0435\u0442, \u0445\u0430\u0431\u0440! \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 WebGL \u0438\u0433\u0440\u044b Digital Trip. \u041f\u043e\u043c\u0438\u043c\u043e WebGL, \u0432 \u0438\u0433\u0440\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0442\u0430\u043a\u0438\u0435 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438, \u043a\u0430\u043a WebAudio API, WebSockets, getUserMedia, Vibration API, DeviceOrientation, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 three.js, hedtrackr.js, sicket.io \u0438 \u043f\u0440. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0443\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u0434\u0435\u0442\u0430\u043b\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u042f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u0434\u0432\u0438\u0436\u043a\u0435 \u0438\u0433\u0440\u044b, \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e, \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0432\u0435\u0431-\u043a\u0430\u043c\u0435\u0440\u043e\u0439, \u0441\u043a\u0430\u0436\u0443 \u043f\u0430\u0440\u0443 \u0441\u043b\u043e\u0432 \u043e back-end\u2019e \u043d\u0430 node.js, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u043c \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 \u0441 dogecoin \u0434\u0435\u043c\u043e\u043d\u043e\u043c.<br \/>  \u0412 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430 GitHub, \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438\u0433\u0440\u044b \u0438 \u0441\u0430\u043c\u0443 \u0438\u0433\u0440\u0443.<br \/>  \u0412\u0441\u0435\u0445, \u043a\u043e\u043c\u0443 \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-230323","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/230323","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=230323"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/230323\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=230323"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=230323"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=230323"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}