{"id":163893,"date":"2012-12-25T15:10:03","date_gmt":"2012-12-25T11:10:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=163893"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=163893","title":{"rendered":"<span class=\"post_title\">\u0421\u043e\u043b\u043d\u0435\u0447\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043d\u0430 LibCanvas<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/a45\/252\/c3b\/a45252c3bd097cb2afa93c473dee4ad8.png\"\/><\/p>\n<p>  \u0412\u0447\u0435\u0440\u0430 \u0431\u044b\u043b \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u0442\u043e\u043f\u0438\u043a, &quot;<a href=\"http:\/\/habrahabr.ru\/post\/163703\/\">\u0418\u0441\u0442\u043e\u0440\u0438\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0445\u0430\u0431\u0440\u0430\u0441\u043f\u043e\u0440\u0430<\/a>&quot;, \u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u00ab\u0433\u0430\u043b\u0430\u043a\u0442\u0438\u043a\u0438\u00bb \u043d\u0430 HTML5 Canvas, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u0434\u0430 \u0441\u0432\u043e\u0438\u043c\u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c\u0438 \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u0438\u043b \u043c\u0435\u043d\u044f \u043d\u0430 \u043e\u0442\u0432\u0435\u0442\u043d\u044b\u0439 \u043a\u043e\u0434. \u0414\u0443\u043c\u0430\u043b, \u0434\u043e \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0445 \u0432\u0435\u0449\u0435\u0439 \u043d\u0430 \u0425\u0430\u0431\u0440\u0443, \u043d\u043e, \u043a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u0441\u043e\u0440\u0432\u0430\u043b\u0441\u044f) \u0421\u043f\u0430\u0441\u0438\u0431\u043e <a href=\"http:\/\/habrahabr.ru\/users\/kibizoidus\/\" class=\"user_link\">kibizoidus<\/a> \u0437\u0430 \u044d\u0442\u043e.<\/p>\n<p>  \u0412 \u0442\u043e\u043f\u0438\u043a\u0435 \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0433\u0430\u043b\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043d\u0430 <a href=\"https:\/\/github.com\/theshock\/libcanvas\">\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 LibCanvas<\/a>. \u0411\u044b\u0441\u0442\u0440\u043e, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e, \u043a\u0440\u0430\u0442\u043a\u043e.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0421\u0440\u0430\u0437\u0443 \u0441\u043a\u0430\u0436\u0443, \u0447\u0442\u043e \u0422\u0417 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u043d\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e. \u041f\u0440\u0438\u0447\u0438\u043d\u0430 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u0430 \u2014 \u043f\u0440\u0438\u0434\u044f \u0432\u0447\u0435\u0440\u0430 \u0432 3 \u0447\u0430\u0441\u0430 \u043d\u043e\u0447\u0438 \u0441 \u00ab\u0425\u043e\u0431\u0431\u0438\u0442\u0430\u00bb \u044f \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043b \u043f\u0435\u0440\u0435\u0434 \u0441\u043e\u0431\u043e\u0439 \u0447\u0451\u0442\u043a\u0438\u0439 \u0434\u0435\u0434\u043b\u0430\u0439\u043d \u2014 <b>\u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0447\u0430\u0441\u0430<\/b> \u043d\u0430 \u0432\u0441\u0451. \u0427\u0435\u0441\u0442\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u044f \u0441\u0447\u0438\u0442\u0438\u043b, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0435\u0449\u0451 \u0443\u0442\u0440\u043e\u043c \u0437\u0430 \u0437\u0430\u0432\u0442\u0440\u0430\u043a\u043e\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043a\u0443\u0440\u0441\u043e\u0440\u0430, \u043d\u043e \u044d\u0442\u043e \u0434\u0435\u0442\u0430\u043b\u0438) \u0412 \u0447\u0430\u0441 \u044f \u0443\u043b\u043e\u0436\u0438\u043b\u0441\u044f.<\/p>\n<p>  \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0438 \u043e\u0442 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0430\u0432\u0442\u043e\u0440\u0430 \u043c\u043d\u0435 \u043d\u0430 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u00abVirtualhost \u0432 \u0441\u0432\u043e\u0435\u043c dev-\u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438, git-\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439\u00bb \u0438 \u0432\u0441\u0451 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u2014 \u0432\u0441\u0451 \u044d\u0442\u043e \u0443 \u043c\u0435\u043d\u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u0432 \u0431\u043e\u044e \u0434\u043b\u044f <a href=\"http:\/\/libcanvas.github.com\/\">libcanvas.github.com\/<\/a>. \u041f\u043e\u0442\u043e\u043c\u0443 \u044f \u0432\u0437\u044f\u043b \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u0438 \u0441\u0440\u0430\u0437\u0443 \u0440\u044b\u043d\u0443\u043b\u0441\u044f \u0432 \u0431\u043e\u0439, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432 <a href=\"https:\/\/github.com\/libcanvas\/libcanvas.github.com\/blob\/master\/games\/solar\/im\/sky.png\">\u043d\u0435\u0431\u043e<\/a> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0444\u043e\u043d\u0430, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043e\u0434\u0438\u043d\u043e\u043a\u0443\u044e \u0447\u0435\u0440\u043d\u043e\u0442\u0443:<\/p>\n<pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; \t&lt;head&gt; \t\t&lt;meta charset=&quot;utf-8&quot; \/&gt; \t\t&lt;title&gt;LibCanvas :: Solar&lt;\/title&gt; \t\t&lt;link href=&quot;\/files\/styles.css&quot; rel=&quot;stylesheet&quot; \/&gt; \t\t&lt;style&gt; html, body { background: url(im\/sky.png) } &lt;\/style&gt; \t\t&lt;script src=&quot;\/files\/js\/atom.js&quot;&gt;&lt;\/script&gt; \t\t&lt;script src=&quot;\/files\/js\/libcanvas.js&quot;&gt;&lt;\/script&gt; \t&lt;\/head&gt; \t&lt;body&gt; \t\t&lt;p&gt;&lt;a href=&quot;\/&quot;&gt;Return to index&lt;\/a&gt;&lt;\/p&gt; \t\t&lt;script&gt; new function () { \tLibCanvas.extract();  \tatom.dom(function () { \t\tnew Solar.Controller(); \t}); }; \t\t&lt;\/script&gt; \t\t&lt;script src=&quot;js\/controller.js&quot;&gt;&lt;\/script&gt; \t&lt;\/body&gt; &lt;\/html&gt; <\/code><\/pre>\n<h2>\u041f\u0435\u0440\u0432\u044b\u0435 \u0448\u0430\u0433\u0438<\/h2>\n<p>  \u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0430\u043c\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0421\u0440\u0430\u0437\u0443 \u0441\u043a\u0430\u0436\u0443 \u2014 \u0441\u0440\u043e\u043a \u0431\u044b\u043b \u043e\u0447\u0435\u043d\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d, \u0442\u0430\u043a \u0447\u0442\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043e\u0439 \u044f \u043d\u0435 \u0437\u0430\u043c\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043b\u0441\u044f \u0438 \u043f\u043e \u0432\u0441\u0435\u043c\u0443 \u043a\u043e\u0434\u0443 \u0440\u0430\u0437\u0431\u0440\u043e\u0441\u0430\u043d\u044b \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0447\u0438\u0441\u043b\u0430 \u0438 \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043d\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u0434\u0435\u0438 \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442. \u041a\u0440\u043e\u043c\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441\u0440\u0430\u0437\u0443 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u0440\u0435\u0434\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0434\u0432\u0443\u0445 \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a \u2014 <a href=\"https:\/\/github.com\/libcanvas\/libcanvas.github.com\/blob\/master\/games\/solar\/im\/sun.png\">\u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0421\u043e\u043b\u043d\u0446\u0430<\/a> \u0438 \u043d\u0430\u0440\u0435\u0437\u043a\u0443 \u0441 <a href=\"https:\/\/github.com\/libcanvas\/libcanvas.github.com\/blob\/master\/games\/solar\/im\/planets.png\">\u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438 \u0432\u0441\u0435\u0445 \u043f\u043b\u0430\u043d\u0435\u0442<\/a>. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0432 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043b\u0435\u0433\u043a\u043e \u0434\u043e \u043d\u0438\u0445 \u0434\u043e\u0441\u0442\u0443\u0447\u0430\u0442\u044c\u0441\u044f.  <\/p>\n<pre><code>\/** @class Solar.Controller *\/ atom.declare('Solar.Controller', { \tinitialize: function () { \t\tthis.size = new Size(840, 840);  \t\tthis.app = new App({ size: this.size });  \t\tatom.ImagePreloader.run({ \t\t\tplanets: 'im\/planets.png', \t\t\tsun    : 'im\/sun.png' \t\t}, this.start.bind(this)); \t}, \t \tstart: function (images) { \t\t\/\/ images ready \t\tthis.app.resources.set( 'images', images ); \t} }); <\/code><\/pre>\n<p>  \u0412\u0441\u0435 \u0430\u0441\u0442\u0440\u043e\u043d\u043e\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0443\u0442 \u043d\u0430 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u043b\u043e\u0435. \u0418\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043d\u0438\u0445 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u043a\u0430\u0434\u0440 \u0438 \u043d\u0435\u0442\u0443 \u0441\u043c\u044b\u0441\u043b\u0430 \u0440\u0435\u0448\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0435 \u0441 \u043f\u0435\u0440\u0435\u0440\u0438\u0441\u043e\u0432\u043a\u043e\u0439. \u041f\u0440\u043e\u0441\u0442\u043e \u0441\u0442\u0430\u0432\u0438\u043c <code>intersection: all<\/code>, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u0432\u0441\u0435 \u043f\u0435\u0440\u0435\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u043b\u0438\u0441\u044c \u0438 <code>invoke: true<\/code>, \u0447\u0442\u043e\u0431\u044b \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043d\u0438\u0445 \u0432\u044b\u0437\u044b\u0432\u0430\u043b\u0441\u044f \u043c\u0435\u0442\u043e\u0434 <code>onUpdate<\/code>  <\/p>\n<pre><code>\/** @class Solar.Controller *\/ \t\/\/ .. \tinitialize: function () { \t\/\/ .. \t\tthis.geoLayer = this.app.createLayer({ \t\t\tname: 'geo', \t\t\tinvoke: true, \t\t\tintersection: 'all', \t\t\tzIndex: 2 \t\t}); \t\/\/ .. <\/code><\/pre>\n<p>  \u0421\u0430\u043c\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0435, \u0447\u0442\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u2014 \u044d\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0443 \u0421\u043e\u043b\u043d\u0446\u0430. \u041e\u043d\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0438 \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u043e \u0441\u0442\u043e\u0438\u0442 \u0432 \u0446\u0435\u043d\u0442\u0440\u0435 \u043a\u0430\u0434\u0440\u0430. \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u0432 \u0442\u043e\u0447\u043a\u0443, \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c\u0441\u044f \u043e\u0442 <code>App.Element<\/code>, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435:  <\/p>\n<pre><code>\/** @class Solar.Sun *\/ atom.declare('Solar.Sun', App.Element, {  \trenderTo: function (ctx, resources) { \t\tctx.drawImage({ \t\t\timage : resources.get('images').get('sun'), \t\t\tcenter: this.shape.center \t\t}); \t}  }); <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0432 \u043d\u0430\u0448\u0435\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043d\u0430\u0448\u0435 \u0421\u043e\u043b\u043d\u0446\u0435:  <\/p>\n<pre><code>\/** @class Solar.Controller *\/ \t\/\/ .. \tstart: function (images) { \t\/\/ .. \t\tthis.sun = new Solar.Sun(this.geoLayer, { \t\t\tshape: new Circle(this.app.rectangle.center, 50) \t\t}); \t\/\/ .. <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0433\u043e\u0440\u0438\u0442 \u043e\u0434\u0438\u043d\u043e\u043a\u043e\u0435 \u0421\u043e\u043b\u043d\u0446\u0435:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/a29\/722\/024\/a29722024a9154128547bb68fc107e77.png\"\/><\/p>\n<h2>\u041f\u043b\u0430\u043d\u0435\u0442\u044b<\/h2>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0446\u0435\u043b\u044c \u2014 \u043f\u043b\u0430\u043d\u0435\u0442\u044b. \u0423 \u043d\u0430\u0441 12 \u043f\u043b\u0430\u043d\u0435\u0442. \u041f\u0435\u0440\u0432\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043d\u0430 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0438 90 \u043f\u0438\u043a\u0441\u0435\u043b\u0435\u0439 \u043e\u0442 \u0446\u0435\u043d\u0442\u0440\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0430, \u043a\u0430\u0436\u0434\u0430\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u043d\u0430 26 \u043f\u0438\u043a\u0441\u0435\u043b\u0435\u0439 \u0434\u0430\u043b\u044c\u0448\u0435. \u041f\u0435\u0440\u0432\u0430\u044f \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u043a\u0440\u0443\u0433 \u0437\u0430 40 \u0441\u0435\u043a\u0443\u043d\u0434, \u043a\u0430\u0436\u0434\u0430\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u043d\u0430 20 \u0441\u0435\u043a\u0443\u043d\u0434 \u0434\u043e\u043b\u044c\u0448\u0435. \u0418 \u0443 \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u043b\u0430\u043d\u0435\u0442\u044b \u0435\u0441\u0442\u044c \u0438\u043c\u044f<\/p>\n<pre><code>\/** @class Solar.Controller *\/ atom.declare('Solar.Controller', { \tnames : 'Selene Mimas Ares Enceladus Tethys Dione Zeus Rhea Titan Janus Hyperion Iapetus' \t\t.split(' '), \t \t\/\/ .. \tstart: function (images) { \t\/\/ .. \t\tfor (var i = 12; i--;) { \t\t\tvar planet = new Solar.Planet(this.geoLayer, { \t\t\t\tsun   : this.sun, \t\t\t\tradius: 90 + i * 26, \t\t\t\ttime  : 40 + i * 20, \t\t\t\timage : i, \t\t\t\tzIndex: 0, \t\t\t\tname  : this.names[i] \t\t\t}); \t\t} \t\/\/ .. <\/code><\/pre>\n<p>  \u0412\u044b\u0432\u043e\u0434\u0438\u043c \u043f\u043b\u0430\u043d\u0435\u0442\u0443 \u043d\u0430 \u043e\u0440\u0431\u0438\u0442\u0443 \u043e\u0447\u0435\u043d\u044c \u043b\u0435\u0433\u043a\u043e \u2014 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u043c \u0435\u0451 \u0432 \u0446\u0435\u043d\u0442\u0440\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0430 \u043f\u043e\u0442\u043e\u043c \u0441\u043c\u0435\u0449\u0430\u0435\u043c \u0432\u043f\u0440\u0430\u0432\u043e \u043d\u0430 \u0440\u0430\u0434\u0438\u0443\u0441 \u043e\u0440\u0431\u0438\u0442\u044b.<\/p>\n<pre><code>\tthis.center = this.solarCenter.clone(); \tthis.center.move([ this.radius, 0 ]); <\/code><\/pre>\n<p>  \u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043d\u0430\u0439\u0442\u0438 \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u2014 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u043b\u0435\u0442\u0430\u0442\u044c 360 \u0433\u0440\u0430\u0434\u0443\u0441\u043e\u0432 \u0437\u0430 <code>'time'<\/code> \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0430\u0445 \u0438\u043b\u0438 360\/1000 \u0437\u0430 \u0432\u0440\u0435\u043c\u044f \u0432 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u0430\u0445:<\/p>\n<pre><code>\tthis.rotatePerMs = (360).degree() \/ 1000 \/ this.settings.get('time'); <\/code><\/pre>\n<p>  \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0438\u0437 \u0441\u043f\u0440\u0430\u0439\u0442\u043e\u0432 \u0432\u044b\u0440\u0435\u0437\u0430\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u2014 \u0441\u043c\u0435\u0449\u0430\u0435\u043c\u0441\u044f \u0432\u043f\u0440\u0430\u0432\u043e \u043d\u0430 \u0438\u043d\u0434\u0435\u043a\u0441 \u043f\u043b\u0430\u043d\u0435\u0442\u044b:<\/p>\n<pre><code>\tgetImagePart: function () { \t\tvar x = this.settings.get('image');  \t\treturn this.layer.app.resources.get('images') \t\t\t.get('planets') \t\t\t.sprite(new Rectangle([ x*this.size.width,0 ],this.size)); \t}, <\/code><\/pre>\n<p>  \u0421\u0430\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043f\u043b\u0430\u043d\u0435\u0442\u044b \u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0446\u0435\u043d\u0442\u0440 \u043f\u043b\u0430\u043d\u0435\u0442\u044b \u0432\u043e\u043a\u0440\u0443\u0433 \u0446\u0435\u043d\u0442\u0440\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043c\u0435\u0442\u043e\u0434\u043e\u043c <code>LibCanvas.Point.rotate<\/code>. <code>normalizeAngle<\/code> \u043d\u0443\u0436\u0435\u043d, \u0447\u0442\u043e\u0431\u044b \u0443\u0433\u043e\u043b \u0432\u0441\u0435\u0433\u0434\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0441\u044f \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 0 \u0438 360 \u0433\u0440\u0430\u0434\u0443\u0441\u043e\u0432.<\/p>\n<pre><code>\trotate: function (angle) { \t\tif (angle == null) angle = Number.random(0, 360).degree();  \t\tthis.angle = (this.angle + angle).normalizeAngle(); \t\tthis.center.rotate(angle, this.solarCenter);  \t\treturn this; \t}, <\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u2014 \u043a\u0430\u0436\u0434\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430 <code>onUpdate<\/code> \u0432\u0435\u0440\u0442\u0438\u043c \u043f\u043b\u0430\u043d\u0435\u0442\u0443, \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u044f \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u043f\u0440\u0430\u0432\u043a\u0443 \u043d\u0430 \u0432\u0440\u0435\u043c\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u043e\u0448\u043b\u043e \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430. <code>onUpdate<\/code>, \u043a\u0430\u043a \u0438 <code>renderTo<\/code> \u2014 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0432 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a LibCanvas \u043c\u0435\u0442\u043e\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435.  <\/p>\n<pre><code>\tonUpdate: function (time) { \t\tthis.rotate(time * this.rotatePerMs); \t\tthis.redraw(); \t}, <\/code><\/pre>\n<p>  \u041d\u0443 \u0438 \u0441\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u2014 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0443 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438:<\/p>\n<pre><code>\trenderTo: function (ctx) { \t\tctx.drawImage({ \t\t\timage : this.image, \t\t\tcenter: this.center, \t\t\tangle : this.angle \t\t}); \t} <\/code><\/pre>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u043a\u0440\u044b\u0442\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>\/** @class Solar.Planet *\/ atom.declare('Solar.Planet', App.Element, {  \tangle: 0,  \tconfigure: function () { \t\tthis.size = new Size(26, 26);  \t\tthis.center = this.solarCenter.clone(); \t\tthis.center.move([ this.radius, 0 ]);  \t\tthis.rotatePerMs = (360).degree() \/ 1000 \/ this.settings.get('time'); \t\tthis.shape = new Circle(this.center, this.size.width\/2); \t\tthis.image  = this.getImagePart(); \t\tthis.rotate(); \t},  \tgetImagePart: function () { \t\tvar x = this.settings.get('image');  \t\treturn this.layer.app.resources.get('images') \t\t\t.get('planets') \t\t\t.sprite(new Rectangle([x*this.size.width,0],this.size)); \t},  \tget radius () { \t\treturn this.settings.get('radius'); \t},  \tget solarCenter () { \t\treturn this.settings.get('sun').shape.center; \t},  \trotate: function (angle) { \t\tif (angle == null) angle = Number.random(0, 360).degree();  \t\tthis.angle = (this.angle + angle).normalizeAngle(); \t\tthis.center.rotate(angle, this.solarCenter);  \t\treturn this; \t},  \tonUpdate: function (time) { \t\tthis.rotate(time * this.rotatePerMs); \t\tthis.redraw(); \t},  \trenderTo: function (ctx) { \t\tctx.drawImage({ \t\t\timage : this.image, \t\t\tcenter: this.center, \t\t\tangle : this.angle \t\t}); \t}  }); <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u043f\u043b\u0430\u043d\u0435\u0442\u044b:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/cc7\/45e\/6d8\/cc745e6d85909691c6a69ec2bb7da260.png\"\/><\/p>\n<h2>\u041e\u0440\u0431\u0438\u0442\u044b<\/h2>\n<p>  \u0414\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u2014 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0440\u0431\u0438\u0442\u044b. \u0423 \u043d\u0438\u0445 \u0435\u0441\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u044f \u043e\u0442 \u043f\u043b\u0430\u043d\u0435\u0442, \u043f\u043e\u0442\u043e\u043c\u0443 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043b\u043e\u0439. <br \/>  \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043e\u043d\u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u043d\u044b. \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0438 \u043e\u0442 \u043f\u043b\u0430\u043d\u0435\u0442 \u2014 \u043d\u0435 \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f, \u0438\u043b\u0438 \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u0440\u0435\u0434\u043a\u043e. \u041a\u0440\u043e\u043c\u0435 \u044d\u0442\u043e\u0433\u043e \u2014 \u043e\u043d\u0438 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043b\u0430\u043d\u0435\u0442 \u0438 \u0438\u0445 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0437\u0430\u0442\u0440\u0430\u0442\u043d\u0435\u0435, \u043f\u043e\u0442\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u043c \u0435\u0451 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0436\u0435.<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0441\u043b\u043e\u0439. \u0412\u044b\u0437\u043e\u0432 <code>onUpdate<\/code> \u043d\u0430\u043c \u0442\u0443\u0442 \u043d\u0435 \u043d\u0443\u0436\u0435\u043d, \u0430 \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e. \u0412\u0441\u0451-\u0440\u0430\u0432\u043d\u043e \u044d\u0442\u0438\u0445 \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439, \u043a\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u043e\u0441\u043e\u0431\u043e \u0438 \u043d\u0435\u0442\u0443. \u041a\u0440\u043e\u043c\u0435 \u044d\u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f, \u0441\u0440\u0430\u0437\u0443 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043c\u0435\u0442\u043e\u0434 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0440\u0431\u0438\u0442\u044b \u0443 \u043f\u043b\u0430\u043d\u0435\u0442\u044b  <\/p>\n<pre><code>\/** @class Solar.Controller *\/ \t\/\/ .. \tinitialize: function () { \t\/\/ .. \t\tthis.orbitLayer = this.app.createLayer({ \t\t\tname: 'orbit', \t\t\tintersection: 'manual', \t\t\tzIndex: 1 \t\t}); \t\/\/ .. \t \tstart: function (images) { \t\/\/ .. \t\tfor (var i = 12; i--;) { \t\t\tvar planet = new Solar.Planet(this.geoLayer, { \t\t\t\t\/\/ .. \t\t\t}); \t\t\tplanet.createOrbit(this.orbitLayer, i); \/\/ &lt;===  \t\t\t\/\/ .. \t\t} \t\/\/ .. \t <\/code><\/pre>\n<pre><code>\/** @class Solar.Planet *\/ \t\/\/ .. \tcreateOrbit: function (layer, z) { \t\treturn this.orbit = new Solar.Orbit(layer, { planet: this, zIndex: z }); \t}, \t\/\/ .. <\/code><\/pre>\n<p>  \u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0434 \u043e\u0440\u0431\u0438\u0442\u044b \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439. \u0421\u043e\u0437\u0434\u0430\u0451\u043c <code>Circle<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0441\u043d\u043e\u0432\u043e\u0439 \u043d\u0430\u0448\u0435\u0439 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438, \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <code>renderTo<\/code> \u043f\u0440\u043e\u0441\u0442\u043e stroke&#8217;\u0430\u0435\u043c \u044d\u0442\u043e\u0442 \u043a\u0440\u0443\u0433. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0447\u0442\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u0435\u0449\u0451 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0441\u044f \u043c\u0435\u0442\u043e\u0434 <code>clearPrevious<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u043e\u0447\u0438\u0441\u0442\u043a\u0438 \u0441\u043b\u043e\u044f \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u2014 \u043c\u044b \u043d\u0435 \u0433\u0440\u0443\u0431\u043e \u043e\u0447\u0438\u0449\u0430\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 BoundingRectangle, \u0430 \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u0435\u043d\u044c\u043a\u043e \u0437\u0430\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u043e\u0431\u0432\u043e\u0434\u043a\u0443 \u043a\u0440\u0443\u0433\u0430 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0438\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u0442\u0440\u043e\u0443\u043a\u0430 <code>ctx.clear(this.shape, true)<\/code>:  <\/p>\n<pre><code>\/** @class Solar.Orbit *\/ atom.declare('Solar.Orbit', App.Element, {  \tconfigure: function () { \t\tthis.shape = new Circle(this.planet.solarCenter, this.planet.radius); \t},  \tget planet () { \t\treturn this.settings.get('planet'); \t},  \tclearPrevious: function (ctx) { \t\tctx.clear(this.shape, true); \t},  \trenderTo: function (ctx, resources) { \t\tctx.stroke(this.shape, 'rgba(0,192,255,0.5)'); \t}  }); <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043e\u0431\u0440\u0435\u043b\u043e \u0432\u0438\u0434, \u0431\u043b\u0438\u0437\u043a\u0438\u0439 \u043a \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c\u0443 \u0438 \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c.<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/671\/3cc\/022\/6713cc02218b1c5ccc509a4e388f3dde.png\"\/><\/p>\n<h2>\u041f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u043c\u044b\u0448\u044c<\/h2>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043e\u0431\u044a\u0435\u043a\u0442 <code>LibCanvas.Mouse<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043b\u043e\u0432\u0438\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043c\u044b\u0448\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0433\u043e dom-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0438 \u043e\u0431\u044a\u0435\u043a\u0442 <code>LibCanvas.App.MouseHandler<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0438 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f  <\/p>\n<pre><code>\/** @class Solar.Controller *\/  \t\/\/ .. \tstart: function (images) { \t\tvar mouse, mouseHandler;  \t\tmouse = new Mouse(this.app.container.bounds); \t\tmouseHandler = new App.MouseHandler({ mouse: mouse, app: this.app });  \t\tthis.app.resources.set({ \t\t\timages: images, \t\t\tmouse : mouse, \t\t\tmouseHandler: mouseHandler \t\t}); \t\t \t\t\/\/ .. \t\t \t\tfor (var i = 12; i--;) { \t\t\tvar planet = new Solar.Planet(this.geoLayer, { \t\t\t\t\/\/ .. \t\t\t}); \t\t\tplanet.createOrbit(this.orbitLayer, i); \t\t\t \t\t\tmouseHandler.subscribe( planet ); \t\t\tmouseHandler.subscribe( planet.orbit ); \t\t} \t} \t \t\/\/ .. <\/code><\/pre>\n<p>  \u041c\u044b\u0448\u044c \u0443\u0436\u0435 \u043b\u043e\u0432\u0438\u0442\u044c\u0441\u044f, \u043d\u043e \u043f\u043e\u043a\u0430 \u043c\u044b \u044d\u0442\u043e \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c. \u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u043e\u0440\u0431\u0438\u0442. \u0421\u0435\u0439\u0447\u0430\u0441 \u043e\u043d\u0430 \u043b\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0435\u0441\u043b\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0435\u0451. \u0422.\u0415. \u043b\u044e\u0431\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u043b\u043d\u0446\u0435\u043c \u0438 \u043f\u043b\u0430\u043d\u0435\u0442\u043e\u0439 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u043e\u043c \u0434\u043b\u044f \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043e\u0440\u0431\u0438\u0442\u044b. \u041c\u044b \u044d\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043c, \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0432 \u043c\u0435\u0442\u043e\u0434 <code>isTriggerPoint<\/code>. \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043c\u044b\u0448\u0438 \u0431\u0443\u0434\u0443\u0442 \u0441\u0440\u0430\u0431\u0430\u0442\u0430\u0432\u0430\u0442\u044c \u043d\u0430 \u043e\u0440\u0431\u0438\u0442\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 13 \u043f\u0438\u043a\u0441\u0435\u043b\u0435\u0439 \u043e\u0442 \u043d\u0435\u0451.  <\/p>\n<pre><code>\/** @class Solar.Orbit *\/  \t\/\/ .. \tisTriggerPoint: function (point) { \t\tvar distance = this.planet.solarCenter.distanceTo(point);  \t\treturn (this.planet.radius - distance).abs() &lt; 13; \t}, \t \t\/\/ .. <\/code><\/pre>\n<p>  \u0421\u0440\u0430\u0437\u0443 \u0436\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u043a\u0430\u043a \u043e\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u2014 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u0435 hover \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f <code>Clickable<\/code> \u0438 \u0441\u043b\u0435\u0433\u043a\u0430 \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u043c\u0435\u0442\u043e\u0434 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438:<\/p>\n<pre><code>\/** @class Solar.Orbit *\/  \t\/\/ .. \tconfigure: function () { \t\t\/\/ .. \t\tApp.Behaviors.attach( this, [ 'Clickable' ], this.redraw).startAll(); \t}, \t\/\/ ..  \trenderTo: function (ctx, resources) { \t\tif (this.hover) { \t\t\tctx.stroke(this.shape, 'rgba(255,64,64,0.8)'); \t\t} else { \t\t\tctx.stroke(this.shape, 'rgba(0,192,255,0.5)'); \t\t} \t} \t\/\/ .. <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/70a\/ad4\/7df\/70aad47dfbfdaf7d84454e51232ee904.png\"\/><\/p>\n<p>  \u0421\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u043e\u0440\u0431\u0438\u0442\u044b \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043f\u0440\u0438 \u043d\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u043c\u044b\u0448\u0438. \u041d\u043e \u043f\u0440\u0438 \u043d\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u043d\u0430 \u043f\u043b\u0430\u043d\u0435\u0442\u0443 \u043c\u044b\u0448\u044c \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438 \u0434\u043e \u043e\u0440\u0431\u0438\u0442\u044b \u0443\u0436\u0435 \u043d\u0435 \u0434\u043e\u0441\u0442\u0430\u0451\u0442. \u0421\u043b\u0435\u0433\u043a\u0430 \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u044d\u0442\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 hover \u043a \u043f\u043b\u0430\u043d\u0435\u0442\u0435 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044f \u043e\u0431\u0430 \u044d\u0442\u0438\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f:<\/p>\n<pre><code>\/** @class Solar.Orbit *\/  \t\/\/ .. \t \tisHover: function () { \t\treturn this.hover || this.planet.hover; \t},  \trenderTo: function (ctx, resources) { \t\tif (this.isHover()) { \t\t\/\/ .. \t} \t\/\/ .. <\/code><\/pre>\n<p>  \u0410 \u0442.\u043a. \u043f\u0440\u0438 \u043d\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u043d\u0430 \u043f\u043b\u0430\u043d\u0435\u0442\u0443 \u043d\u0430\u043c \u0432\u0441\u0451-\u0440\u0430\u0432\u043d\u043e \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u043e\u0440\u0431\u0438\u0442\u0443 \u043a\u0430\u0436\u0434\u044b\u0439 \u043a\u0430\u0434\u0440 (\u043a\u0440\u0443\u0433 \u0432\u043e\u043a\u0440\u0443\u0433 \u043f\u043b\u0430\u043d\u0435\u0442\u044b \u0441\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0442\u043e) \u2014 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c <code>redraw<\/code> \u0432 <code>onUpdate<\/code>  <\/p>\n<pre><code>\/** @class Solar.Planet *\/  \t\/\/ .. \tconfigure: function () { \t\t\/\/ .. \t\tApp.Behaviors.attach( this, [ 'Clickable' ], this.redraw).startAll(); \t}, \t\/\/ ..  \tonUpdate: function (time) { \t\t\/\/ .. \t\tif (this.orbit.isHover()) this.orbit.redraw(); \t}, \t\/\/ .. <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043b\u0430\u043d\u0435\u0442\u0430 \u043d\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442 hover \u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u043d\u044f\u0442\u0441\u044f \u0441\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043e\u0440\u0431\u0438\u0442\u044b. \u0417\u0430\u0434\u0430\u0447\u0443 \u043c\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043e\u0447\u0435\u043d\u044c \u043b\u0435\u0433\u043a\u043e. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u043e\u0440\u0431\u0438\u0442\u0443. \u041f\u043e\u0442\u043e\u043c \u0441\u0442\u0438\u0440\u0430\u0435\u043c shape \u043f\u043b\u0430\u043d\u0435\u0442\u044b, \u0430 \u043f\u043e\u0442\u043e\u043c \u043e\u0431\u0432\u043e\u0434\u0438\u043c shape \u043f\u043b\u0430\u043d\u0435\u0442\u044b. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u043d\u0435\u043d\u0430\u043f\u0440\u044f\u0436\u043d\u043e \u0434\u043e\u0441\u0442\u0438\u0447\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430:<\/p>\n<pre><code>\/** @class Solar.Orbit *\/ \t\/\/ .. \trenderTo: function (ctx, resources) { \t\tif (this.isHover()) { \t\t\tctx.save(); \t\t\tctx.set({ strokeStyle: 'rgb(0,192,255)', lineWidth: 3 }); \t\t\tctx.stroke(this.shape); \t\t\tctx.clear(this.planet.shape); \t\t\tctx.stroke(this.planet.shape); \t\t\tctx.restore(); \t\t} else { \t\t\tctx.stroke(this.shape, 'rgba(0,192,255,0.5)'); \t\t} \t} <\/code><\/pre>\n<p>  \u041d\u043e \u0442\u0443\u0442 \u043d\u0430\u0441 \u0437\u0430\u0441\u0442\u0430\u043d\u0435\u0442 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u2014 \u043d\u0430\u0448 \u00ab\u0447\u0438\u0441\u0442\u0438\u043b\u044c\u0449\u0438\u043a\u00bb \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u043d\u0438 \u043f\u0440\u043e \u0442\u043e\u043b\u0449\u0438\u043d\u0443 \u043e\u0440\u0431\u0438\u0442\u044b \u043d\u0438, \u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435, \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430 \u043d\u0435\u0439 \u0435\u0449\u0451 \u0435\u0441\u0442\u044c \u00ab\u0433\u0440\u044b\u0436\u0430\u00bb \u043e\u0442 \u043f\u043b\u0430\u043d\u0435\u0442\u044b. \u041f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u043c\u0435\u0442\u043e\u0434 LibCanvas \u2014 <code>saveCurrentBoundingShape<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c, \u0433\u0434\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0440\u0430\u0437 \u0431\u044b\u043b\u0430 \u0433\u0440\u044b\u0436\u0430, \u0435\u0441\u043b\u0438 \u0431\u044b\u043b\u0430 \u0432\u043e\u043e\u0431\u0449\u0435. \u041e\u043d \u0442\u0430\u043a \u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438:  <\/p>\n<pre><code>\/** @class Solar.Orbit *\/ \t\/\/ ..  \tsaveCurrentBoundingShape: function () { \t\tif (this.isHover()) { \t\t\tthis.previousBoundingShape = this.planet.shape.clone().grow(6); \t\t} else { \t\t\tthis.previousBoundingShape = null; \t\t} \t\treturn this; \t}, <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c \u043d\u0430\u0448\u0435\u043c\u0443 \u0447\u0438\u0441\u0442\u0438\u043b\u044c\u0449\u0438\u043a\u0443 \u043e \u043d\u043e\u0432\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445. \u0415\u0441\u043b\u0438 \u0433\u0440\u044b\u0436\u0438 \u043d\u0435 \u0431\u044b\u043b\u043e \u2014 \u0447\u0438\u0441\u0442\u0438\u043c \u043f\u043e \u0441\u0442\u0430\u0440\u043e\u043c\u0443. \u0418\u043d\u0430\u0447\u0435 \u2014 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u043c \u0442\u043e\u043b\u0449\u0438\u043d\u0443, \u0447\u0442\u043e\u0431\u044b \u0445\u043e\u0440\u043e\u0448\u043e \u0441\u0442\u0435\u0440\u0435\u0442\u044c, \u0447\u0438\u0441\u0442\u0438\u043c \u0433\u0440\u044b\u0436\u0443 \u0438 \u043f\u043e\u0442\u043e\u043c \u0432\u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0445\u043e\u043b\u0441\u0442\u0430:  <\/p>\n<pre><code>\/** @class Solar.Orbit *\/ \t\/\/ ..  \tclearPrevious: function (ctx) { \t\tif (this.previousBoundingShape) { \t\t\tctx.save(); \t\t\tctx.set({ lineWidth: 4 }); \t\t\tctx.clear(this.previousBoundingShape); \t\t\tctx.clear(this.shape, true); \t\t\tctx.restore(); \t\t} else { \t\t\tctx.clear(this.shape, true); \t\t} \t}, <\/code><\/pre>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u043e\u0432\u043d\u043e \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/e12\/1b8\/8e9\/e121b88e96e98eae834b189e09b50140.png\"\/><\/p>\n<h2>\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u043b\u0430\u043d\u0435\u0442\u0435<\/h2>\n<p>  \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435, \u0447\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u2014 \u0432\u0441\u043f\u043b\u044b\u0432\u0430\u044e\u0449\u0435\u0435 \u043e\u043a\u043e\u0448\u043a\u043e \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u043b\u0430\u043d\u0435\u0442\u044b. \u041c\u044b \u0431\u044b \u043c\u043e\u0433\u043b\u0438 \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f <code>mouseover<\/code> \u0438 <code>mouseout<\/code> \u0443 <code>Solar.Planet<\/code>, \u043d\u043e \u043e\u043d\u0438 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0438 \u043c\u044b\u0448\u0438, \u0442.\u0435. \u0435\u0441\u043b\u0438 \u043f\u043b\u0430\u043d\u0435\u0442\u0430 \u0443\u0435\u0434\u0435\u0442 \u0438\u0437 \u043f\u043e\u0434 \u043d\u0435\u043f\u043e\u0434\u0432\u0438\u0436\u043d\u043e\u0439 \u043c\u044b\u0448\u0438 \u2014 <code>mouseout<\/code> \u043d\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041f\u043e\u0442\u043e\u043c\u0443 \u043c\u044b \u0431\u0435\u0440\u0451\u043c \u0442\u043e\u0447\u043a\u0443 \u043c\u044b\u0448\u0438 \u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u043a\u0430\u0434\u0440 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u043d\u043e \u043d\u0435\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043b\u0438 \u043e\u043d\u0430 \u043d\u0430\u0434 \u043d\u0430\u0448\u0435\u0439 \u043f\u043b\u0430\u043d\u0435\u0442\u043e\u0439.  <\/p>\n<pre><code>\/** @class Solar.Planet *\/ \t\/\/ ..  \tconfigure: function () { \t\t\/\/ .. \t\tthis.mousePoint = this.layer.app.resources.get('mouse').point; \t\tthis.info = new Solar.Info(this.layer, { planet: this, zIndex: 1 }); \t},  \tcheckStatus: function (visible) { \t\tif (this.info.isVisible() != visible) { \t\t\tthis.info[visible ? 'show' : 'hide'](); \t\t} \t},  \tonUpdate: function (time) { \t\t\/\/ .. \t\tthis.checkStatus(this.isTriggerPoint(this.mousePoint)); \t\t\/\/ \u0441\u043c\u0435\u0449\u0430\u0435\u043c \u0444\u0438\u0433\u0443\u0440\u0443 \u0438\u043d\u0444\u043e \u0431\u043b\u043e\u043a\u0430 \u0437\u0430 \u043d\u0430\u0448\u0435\u0439 \u043f\u043b\u0430\u043d\u0435\u0442\u043e\u0439 \t\tif (this.info.isVisible()) this.info.updateShape(this.shape.center); \t}, \t \t\/\/ .. <\/code><\/pre>\n<p>  <code>settings: { hidden: true }<\/code> \u2014 \u043e\u0434\u043d\u0430 \u0438\u0437 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a LibCanvas. \u042d\u0442\u043e\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0443\u0447\u0430\u0432\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0435, \u043d\u043e \u0432\u0441\u0451 \u0442\u0430\u043a \u0436\u0435 \u043b\u043e\u0432\u0438\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043c\u044b\u0448\u0438, \u0435\u0441\u043b\u0438 \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d. \u041f\u043e\u0442\u043e\u043c\u0443 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 <code>Solar.Info<\/code>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u044d\u0442\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c.<\/p>\n<pre><code>\/** @class Solar.Info *\/ atom.declare('Solar.Info', App.Element, {  \tsettings: { hidden: true },  \tget planet () { \t\treturn this.settings.get('planet'); \t},  \tconfigure: function () { \t\tthis.shape = new Rectangle(0,0,100,30); \t},  \tupdateShape: function (from) { \t\tthis.shape.moveTo(from).move([20,10]) \t},  \tshow: function () { \t\tthis.settings.set({ hidden: false }); \t\tthis.redraw(); \t},  \thide: function () { \t\tthis.settings.set({ hidden: true }); \t\tthis.redraw(); \t},  \trenderTo: function (ctx) { \t\tctx.fill(this.shape, '#002244'); \t\tctx.text({ \t\t\tto   : this.shape, \t\t\ttext : this.planet.settings.get('name'), \t\t\tcolor: '#0ff', \t\t\talign: 'center', \t\t\toptimize: false, \t\t\tpadding: 3 \t\t}) \t} }); <\/code><\/pre>\n<p>  \u0418 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/9d5\/1b8\/a2f\/9d51b8a2faab4ee691f6f94102336f70.png\"\/><br \/>  \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435, \u0447\u0442\u043e \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u2014 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043a\u0443\u0440\u0441\u043e\u0440\u0430 \u043c\u044b\u0448\u0438 \u043f\u0440\u0438 \u043d\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u043d\u0430 \u043f\u043b\u0430\u043d\u0435\u0442\u0443:  <\/p>\n<pre><code>\/** @class Solar.Planet *\/ \t\/\/ ..  \tcheckStatus: function (visible) { \t\tif (this.info.isVisible() != visible) { \t\t\tthis.info[visible ? 'show' : 'hide'](); \t\t\tthis.layer.dom.element.css('cursor', visible ? 'pointer' : 'default'); \t\t} \t}, \t \t\/\/ .. <\/code><\/pre>\n<h2>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/h2>\n<p>  \u0421\u043c\u043e\u0442\u0440\u0438\u043c <a href=\"http:\/\/libcanvas.github.com\/games\/solar\/\">\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0430 GitHub<\/a>, \u0430 \u0442\u0430\u043a\u0436\u0435 <a href=\"https:\/\/github.com\/libcanvas\/libcanvas.github.com\/blob\/master\/games\/solar\/\">\u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438<\/a>.<\/p>\n<p>  \u0422\u0430\u043a \u0436\u0435 \u0441\u0440\u0430\u0432\u043d\u0438\u043c \u0441 \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0442\u043e\u043f\u0438\u043a\u0430:<br \/>  1. \u0417\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u0435\u043d\u044c\u0448\u0435 \u043a\u043e\u0434\u0430<br \/>  2. \u0417\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0448\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/p>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0432 \u043f\u0440\u043e\u0444\u0430\u0439\u043b\u0435. \u0427\u0435\u043c \u0432\u044b\u0448\u0435 \u043f\u0440\u043e\u0446\u0435\u043d\u0442 <code>(program)<\/code> \u2014 \u0442\u0435\u043c \u043b\u0443\u0447\u0448\u0435. \u041d\u0430 \u043f\u0443\u0441\u0442\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043e\u043d \u0434\u043e\u0445\u043e\u0434\u0438\u0442 \u0434\u043e 100%.<\/p>\n<p>  \u041e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f:<br \/>  <img decoding=\"async\" src=\"http:\/\/funkyimg.com\/u2\/2832\/173\/456065default-solar-profile.png\"\/><\/p>\n<p>  \u0412\u0435\u0440\u0441\u0438\u044f \u043d\u0430 LibCanvas:<br \/>  <img decoding=\"async\" src=\"http:\/\/funkyimg.com\/u2\/2832\/175\/960663libcanvas-solar-profile.png\"\/><\/p>\n<p>  \u041f\u0443\u0441\u0442\u0430\u044f \u0432\u043a\u043b\u0430\u0434\u043a\u0430:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/e05\/164\/c7c\/e05164c7c24b25df8479e83276352af2.png\"\/><\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u044f \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b \u043d\u0430 \u0441\u043b\u0430\u0431\u043e\u043c \u043d\u043e\u0443\u0442\u0435 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c (\u0444\u043f\u0441\/\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043e\u0434\u043d\u043e\u0433\u043e \u044f\u0434\u0440\u0430 \u043f\u0440\u043e\u0446\u0430):<\/p>\n<p>  \u041e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u2014 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0434\u043e 100%, 44 fps:<br \/>  <img decoding=\"async\" src=\"http:\/\/funkyimg.com\/u2\/2832\/172\/184318default-solar-fps.png\"\/><\/p>\n<p>  \u0412\u0435\u0440\u0441\u0438\u044f \u043d\u0430 LibCanvas \u2014 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0434\u043e 40%, \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0435 60 fps:<br \/>  <img decoding=\"async\" src=\"http:\/\/funkyimg.com\/u2\/2832\/174\/315660libcanvas-solar-fps.png\"\/><\/p>\n<p>  \u041f\u0438\u0448\u0438\u0442\u0435 \u043a\u043e\u0434 \u0432 \u0443\u0434\u043e\u0432\u043e\u043b\u044c\u0441\u0442\u0432\u0438\u0435, \u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c \u0445\u043e\u0440\u043e\u0448\u0438\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438, \u043d\u0430\u0441\u043b\u0430\u0436\u0434\u0430\u0439\u0442\u0435\u0441\u044c. \u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u0430 \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 \u0437\u0430\u0434\u0430\u0442\u044c \u043d\u0435 \u0438\u043c\u0435\u0435\u0442\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u2014 \u043f\u0438\u0448\u0438\u0442\u0435 \u043d\u0430 \u0435\u043c\u0435\u0439\u043b shocksilien@gmail.com    \t   \t<\/p>\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\/post\/163893\/\"> http:\/\/habrahabr.ru\/post\/163893\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/a45\/252\/c3b\/a45252c3bd097cb2afa93c473dee4ad8.png\"\/><\/p>\n<p>  \u0412\u0447\u0435\u0440\u0430 \u0431\u044b\u043b \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u0442\u043e\u043f\u0438\u043a, &quot;<a href=\"http:\/\/habrahabr.ru\/post\/163703\/\">\u0418\u0441\u0442\u043e\u0440\u0438\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0445\u0430\u0431\u0440\u0430\u0441\u043f\u043e\u0440\u0430<\/a>&quot;, \u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u00ab\u0433\u0430\u043b\u0430\u043a\u0442\u0438\u043a\u0438\u00bb \u043d\u0430 HTML5 Canvas, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u0434\u0430 \u0441\u0432\u043e\u0438\u043c\u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c\u0438 \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u0438\u043b \u043c\u0435\u043d\u044f \u043d\u0430 \u043e\u0442\u0432\u0435\u0442\u043d\u044b\u0439 \u043a\u043e\u0434. \u0414\u0443\u043c\u0430\u043b, \u0434\u043e \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0445 \u0432\u0435\u0449\u0435\u0439 \u043d\u0430 \u0425\u0430\u0431\u0440\u0443, \u043d\u043e, \u043a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u0441\u043e\u0440\u0432\u0430\u043b\u0441\u044f) \u0421\u043f\u0430\u0441\u0438\u0431\u043e <a href=\"http:\/\/habrahabr.ru\/users\/kibizoidus\/\" class=\"user_link\">kibizoidus<\/a> \u0437\u0430 \u044d\u0442\u043e.<\/p>\n<p>  \u0412 \u0442\u043e\u043f\u0438\u043a\u0435 \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0433\u0430\u043b\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043d\u0430 <a href=\"https:\/\/github.com\/theshock\/libcanvas\">\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 LibCanvas<\/a>. \u0411\u044b\u0441\u0442\u0440\u043e, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e, \u043a\u0440\u0430\u0442\u043a\u043e.  <\/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-163893","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/163893","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=163893"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/163893\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=163893"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=163893"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=163893"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}