{"id":184818,"date":"2013-09-09T10:50:02","date_gmt":"2013-09-09T06:50:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=184818"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=184818","title":{"rendered":"<span class=\"post_title\">\u041f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u0430\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043f\u043b\u0430\u043d\u043e\u0432 \u043a\u043e\u043c\u043d\u0430\u0442<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" align=\"left\" src=\"http:\/\/habrastorage.org\/storage3\/7d8\/baf\/7ab\/7d8baf7ab46d91e6ef1e8f000823b74e.gif\"\/><br \/>  \u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043a\u0440\u0443\u043f\u043d\u044b\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u0433\u0440, \u043a\u043e\u0433\u0434\u0430 \u0435\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0441\u0442\u0440\u044f\u043f\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043c\u0435\u0449\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043c\u0438\u0440\u0430? \u041d\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043a\u0443\u0447\u0443 \u0445\u0443\u0434\u043e\u0436\u043d\u0438\u043a\u043e\u0432. \u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043b\u0435\u043d\u0438\u0432\u044b\u0439\/\u0431\u0435\u0434\u043d\u044b\u0439\/\u043e\u0434\u0438\u043d\u043e\u043a\u0438\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u0433\u0440 \u0432 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438? \u041f\u0438\u0448\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u044b\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0437\u0430 \u043d\u0435\u0433\u043e \u0432\u0441\u044e \u0433\u0440\u044f\u0437\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443.<\/p>\n<p>  \u041f\u043e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u043e\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u043b\u0430\u043d\u043e\u0432 \u043f\u043e\u043c\u0435\u0449\u0435\u043d\u0438\u0439 \u0435\u0441\u0442\u044c <a href=\"http:\/\/arxiv.org\/pdf\/1211.5842.pdf\">\u043c\u043d\u043e\u0433\u043e<\/a>, <a href=\"http:\/\/cs.stanford.edu\/people\/eschkufz\/research\/a181-merrell.pdf\">\u043e\u0447\u0435\u043d\u044c<\/a> <a href=\"http:\/\/dspace.mit.edu\/bitstream\/handle\/1721.1\/45649\/399893067.pdf\">\u043c\u043d\u043e\u0433\u043e<\/a> <a href=\"https:\/\/dr.library.brocku.ca\/bitstream\/handle\/10464\/3409\/Brock_Flack_Robert_2011.pdf?sequence=1\">\u0441\u0442\u0430\u0442\u0435\u0439<\/a>. <a href=\"http:\/\/graphics.tudelft.nl\/~rval\/papers\/tutenel.tciaig11.pdf\">\u0412\u043e\u0442<\/a> <a href=\"http:\/\/rvsn.csail.mit.edu\/Pubs\/master_whiting_2006june_bmgwriteup.pdf\">\u0435\u0449\u0451<\/a> <a href=\"http:\/\/www.generativeart.com\/on\/cic\/GA2010\/2010_18.pdf\">\u043f\u044f\u0442\u043e\u043a<\/a> <a href=\"http:\/\/axon.cs.byu.edu\/Dan\/673\/papers\/martin.pdf\">\u0441\u0441\u044b\u043b\u043e\u043a<\/a> <a href=\"http:\/\/iv.csit.carleton.ca\/~awhitehe\/pubs\/SIGGRAPH2006.pdf\">\u043d\u0430<\/a> <a href=\"http:\/\/www.benbradley.com\/files\/picag.pdf\">\u0441\u0442\u0430\u0442\u044c\u0438<\/a>. \u0412\u043e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 \u043d\u0438 \u043a \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043d\u0438\u0445 \u043d\u0435\u0442.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u043d\u0430 Unity3d \u043e\u0434\u0438\u043d \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043c\u0435\u0442\u043e\u0434 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0445\u043e\u0440\u043e\u0448\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c \u0438 \u043b\u0435\u0433\u043a\u043e \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u0442\u0441\u044f. \u0421 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430\u043c\u0438 \u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u043c\u0438.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435, \u0442\u043e \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"http:\/\/graphics.tudelft.nl\/~rval\/papers\/lopes.GAMEON10.pdf\">\u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e<\/a>, \u043d\u043e \u0441\u0443\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f:  <\/p>\n<ul>\n<li>\u0412\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u0431\u0438\u0442\u043e \u043d\u0430 \u043a\u043b\u0435\u0442\u043a\u0438 \u043d\u0430\u043f\u043e\u0434\u043e\u0431\u0438\u0435 \u0441\u0435\u0442\u043a\u0438 \u0432 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0445 \u043f\u043b\u0430\u043d\u0430\u0445.<\/li>\n<li>\u0412\u043d\u0435\u0448\u043d\u0438\u0435 \u0441\u0442\u0435\u043d\u044b \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0438 \u043f\u043e\u0434\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u0432\u0445\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435.<\/li>\n<li>\u0415\u0441\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043c\u043d\u0430\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043d\u0430 \u043f\u043b\u0430\u043d\u0435.<\/li>\n<li>\u041a\u043e\u043c\u043d\u0430\u0442\u044b \u0438\u043c\u0435\u044e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u00ab\u0436\u0435\u043b\u0430\u0435\u043c\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440\u00bb \u0438 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b \u043f\u0440\u0438\u0442\u044f\u0436\u0435\u043d\u0438\u044f \u0434\u0440\u0443\u0433 \u043a \u0434\u0440\u0443\u0433\u0443<\/li>\n<li>\u0422\u043e\u0447\u043a\u0438 \u0440\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043d\u0430\u0442 \u0440\u0430\u0441\u043a\u0438\u0434\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u043e \u043f\u043b\u0430\u043d\u0443 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0435\u043a\u043e\u0435\u0439 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e\u0439 \u043a\u0430\u0440\u0442\u044b.<\/li>\n<li>\u0417\u0430\u0442\u0435\u043c \u043a\u0430\u0436\u0434\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u0442\u0438 \u043f\u043e\u043a\u0430 \u043d\u0435 \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043d\u0435\u0451 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432.<\/li>\n<li>\u041a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0438 \u0432\u044b\u0440\u043e\u0441\u043b\u0438, \u043a\u043e\u043c\u043d\u0430\u0442\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u0440\u0430\u0441\u0442\u0438 \u0432 \u0444\u043e\u0440\u043c\u0435 \u0431\u0443\u043a\u0432\u044b L \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e.<\/li>\n<li>\u041e\u0441\u0442\u0430\u0432\u0448\u0435\u0435\u0441\u044f \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u043f\u0440\u0438\u0441\u0442\u0451\u0433\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043a \u0441\u043e\u0441\u0435\u0434\u044f\u043c.<\/li>\n<\/ul>\n<p>  \u041a\u043e\u043c\u043d\u0430\u0442\u044b \u0440\u0430\u0441\u0442\u0443\u0442 \u043f\u043e \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0435\u043d\u043a\u0435 \u0437\u0430 \u0440\u0430\u0437, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043d\u0430\u043f\u043e\u043b\u0437\u0430\u043d\u0438\u044f \u0441\u0442\u0435\u043d \u0438 \u043a\u043e\u043c\u043d\u0430\u0442 \u0434\u0440\u0443\u0433 \u043d\u0430 \u0434\u0440\u0443\u0433\u0430. \u0421\u0442\u0435\u043d\u043a\u0430 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0441\u0442\u0435\u043d \u043a\u043e\u043c\u043d\u0430\u0442\u044b, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u2014 \u0431\u0435\u0440\u0451\u0442\u0441\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0430\u044f. \u041d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0441\u0442\u0435\u043d\u0430 \u0431\u0435\u0440\u0451\u0442\u0441\u044f \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0440\u043e\u0441\u0442 \u043f\u043b\u043e\u0449\u0430\u0434\u0438 \u043a\u043e\u043c\u043d\u0430\u0442 \u0431\u044b\u043b \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c, \u0438 \u043e\u043d\u0438 \u0431\u044b\u043b\u0438 \u00ab\u043f\u0443\u0445\u043b\u044b\u043c\u0438\u00bb.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u043e \u043c\u043e\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e. \u042f \u043d\u0435 \u0441\u0442\u0430\u043b \u043f\u043e\u043a\u0430 \u0437\u0430\u043c\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u0440\u0435\u0430\u043b\u0438\u0441\u0442\u0438\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u043a\u0438, \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430\u043c\u0438 \u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u0430\u043c\u0438 \u043a\u043e\u043c\u043d\u0430\u0442 \u2014 \u044d\u0442\u043e \u0432\u0441\u0451 \u0443\u043a\u0440\u0430\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430, \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043d\u0430\u0434 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c, \u0432\u0441\u0451 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c. \u0422\u0430\u043a\u0436\u0435 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f \u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430\u0445, \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0438\u0445 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u041f-\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u043e\u043c\u043d\u0430\u0442, \u044f \u043d\u0435 \u0441\u0442\u0430\u043b \u0438\u0445 \u0434\u0435\u043b\u0430\u0442\u044c, \u043d\u0435 \u0432\u0438\u0436\u0443 \u043d\u0438\u0447\u0435\u0433\u043e \u043f\u043b\u043e\u0445\u043e\u0433\u043e \u0432 \u0442\u0430\u043a\u0438\u0445 \u043a\u043e\u043c\u043d\u0430\u0442\u0430\u0445. \u0422\u0430\u043a\u0436\u0435 \u044f \u043d\u0435 \u0440\u0430\u0441\u0441\u0442\u0430\u0432\u043b\u044f\u043b \u043a\u043e\u0440\u0438\u0434\u043e\u0440\u044b, \u0434\u0432\u0435\u0440\u0438 \u0438 \u043e\u043a\u043d\u0430, \u044d\u0442\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0442\u0435\u043c\u0430, \u0438 \u0438\u0445 \u0440\u0430\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u0441\u0435\u0433\u043e \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u0434\u0430\u043d\u0438\u044f.<\/p>\n<p>  \u0421\u0430\u043c\u044b\u043c \u0441\u043b\u043e\u0436\u043d\u044b\u043c \u0431\u044b\u043b\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u043e\u0441\u0442\u0430 \u043a\u043e\u043c\u043d\u0430\u0442 \u0438 \u0441\u043f\u043e\u0441\u043e\u0431 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u043d\u0438\u0445 \u0438 \u0437\u0434\u0430\u043d\u0438\u0438. \u041e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u0435\u0442\u043e\u0447\u043d\u044b\u0445 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043e\u0432 \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0431\u0435\u0433\u0430 \u043f\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0443. \u042f \u043f\u0435\u0440\u0435\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432, \u043c\u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u043c\u0435\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e \u0433\u0430\u0431\u0430\u0440\u0438\u0442\u0430\u0445 \u043a\u043e\u043c\u043d\u0430\u0442\u044b \u0438 \u0442\u043e\u0447\u043d\u043e\u043c \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0435\u0451 \u0441\u0442\u0435\u043d, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0441\u043e\u0437\u0434\u0430\u043b \u043a\u043b\u0430\u0441\u0441, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0433\u043b\u044b \u043a\u043e\u043c\u043d\u0430\u0442\u044b, \u0430 \u0441\u0442\u0435\u043d\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u043f\u0443\u0442\u0451\u043c \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f \u0434\u0432\u0443\u0445 \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0445 \u0443\u0433\u043b\u043e\u0432.<br \/>  <img decoding=\"async\" align=\"right\" src=\"http:\/\/habrastorage.org\/storage3\/d40\/c38\/e53\/d40c38e53f0e36b01be2c78fea705816.gif\"\/><br \/>  \u0421\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0435\u043d \u044d\u0442\u043e \u043f\u043e \u0441\u0443\u0442\u0438 \u043f\u043e\u0438\u0441\u043a \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0438 \u043f\u043e\u043b\u0438\u0433\u043e\u043d\u0430 \u0438\u0437 \u043d\u0430\u0431\u043e\u0440\u0430 \u0442\u043e\u0447\u0435\u043a. \u0417\u0430\u0434\u0430\u0447\u0430 \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0438 \u0441 \u043a\u0443\u0447\u0435\u0439 \u043f\u043e\u0434\u0432\u043e\u0445\u043e\u0432, \u0435\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0442\u043e \u0441\u043e\u0432\u0435\u0442\u0443\u044e \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c <a href=\"http:\/\/en.wikipedia.org\/wiki\/Convex_hull_algorithms\">\u0441\u044e\u0434\u0430<\/a>. \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u044f \u0440\u0435\u0448\u0438\u043b \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c\u0441\u044f \u043f\u0440\u044f\u043c\u044b\u043c\u0438 \u0443\u0433\u043b\u0430\u043c\u0438 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u043c\u0438 \u0441\u0442\u0435\u043d\u0430\u043c\u0438 \u0438 \u0441\u043c\u0430\u0441\u0442\u0435\u0440\u0438\u043b \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u0438\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c:  <\/p>\n<ul>\n<li>\u041d\u0430\u0445\u043e\u0434\u0438\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 X \u0438 Y \u0432 \u043d\u0430\u0431\u043e\u0440\u0435 \u0442\u043e\u0447\u0435\u043a.<\/li>\n<li>\u0418\u0437 \u0442\u043e\u0447\u043a\u0438 (minX, minY) \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u0441\u044f \u043d\u0430\u0432\u0435\u0440\u0445 \u043f\u043e \u0438\u0433\u0440\u0435\u043a\u0443 \u0438 \u043f\u043e\u043e\u0447\u0435\u0440\u0451\u0434\u043d\u043e \u0438\u0449\u0435\u043c \u0442\u043e\u0447\u043a\u0443 \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c\u0438, \u0435\u0441\u043b\u0438 \u0435\u0451 \u0442\u0430\u043c \u043d\u0435\u0442, \u0442\u043e \u0438\u0449\u0435\u043c \u0441\u043f\u0440\u0430\u0432\u0430, \u0441\u043d\u0438\u0437\u0443 \u0438 \u0441\u043b\u0435\u0432\u0430. \u041a\u043e\u0433\u0434\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u043c, \u0432\u044b\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u0435\u043c \u0435\u0451 \u0438\u0437 \u0441\u0442\u0430\u0440\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430, \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c \u0432 \u043d\u043e\u0432\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a.<\/li>\n<li>\u041e\u0442 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u044d\u0442\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0432 \u0441\u0442\u0430\u0440\u043e\u043c \u0441\u043f\u0438\u0441\u043a\u0435 \u0438\u0449\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0442\u043e\u0447\u043a\u0443 \u0432\u044b\u0448\u0435 \u043f\u043e \u0438\u0433\u0440\u0435\u043a\u0443, \u0435\u0441\u043b\u0438 \u043d\u0430\u0448\u043b\u0438 \u2014 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c \u0432 \u043d\u043e\u0432\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a, \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0438\u0437 \u0441\u0442\u0430\u0440\u043e\u0433\u043e, \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u043d\u0430\u0448\u043b\u0438 \u0441\u0442\u0435\u043d\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u0430 Y, \u0437\u043d\u0430\u0447\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0441\u0442\u0435\u043d\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u0430 X.<\/li>\n<li>\u0418\u0449\u0435\u043c \u0442\u043e\u0447\u043a\u0443 \u043f\u043e \u0438\u043a\u0441\u0443 \u0441\u043f\u0440\u0430\u0432\u0430 \u0438 \u0441\u043b\u0435\u0432\u0430, \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c \u0432 \u043d\u043e\u0432\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a, \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c \u043e\u0440\u0438\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u043e\u0439 \u0441\u0442\u0435\u043d\u044b, \u0438\u0449\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435 \u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438.<\/li>\n<li>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0442\u043e\u0447\u043a\u0443 \u0432 \u0441\u0442\u0430\u0440\u043e\u043c \u0441\u043f\u0438\u0441\u043a\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c \u0432 \u043d\u043e\u0432\u044b\u0439.<\/li>\n<\/ul>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0443\u0433\u043b\u043e\u0432 \u043a\u043e\u043c\u043d\u0430\u0442\u044b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">    public GridVector SortCorners()     {         \/\/ \u0418\u0449\u0435\u043c \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u043a\u043e\u043c\u043d\u0430\u0442\u044b         var minX = corners[0].x;         var maxX = corners[0].x;         var minY = corners[0].y;         var maxY = corners[0].y;         foreach (var corner in corners)         {             if (corner.x &lt; minX) minX = corner.x;             if (corner.x &gt; maxX) maxX = corner.x;             if (corner.y &lt; minY) minY = corner.y;             if (corner.y &gt; maxY) maxY = corner.y;         }          \/\/ \u0421\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0443\u0433\u043b\u044b \u043a\u043e\u043c\u043d\u0430\u0442\u044b         var oldC = new List&lt;GridVector&gt;(corners);         var newC = new List&lt;GridVector&gt;();         bool parallelX = false;         while (oldC.Count &gt; 1)         {             \/\/ \u0418\u0449\u0435\u043c \u043f\u0435\u0440\u0432\u044b\u0439 \u0443\u0433\u043e\u043b             if (newC.Count == 0)             {                 if (ScanUp(ref oldC, ref newC, minX, minY, maxY)) continue;                 if (ScanRight(ref oldC, ref newC, minX, minY, maxX)) continue;                 if (ScanDown(ref oldC, ref newC, minX, minY, minY)) continue;                 if (!ScanLeft(ref oldC, ref newC, minX, minY, minX))                 {                     Debug.Log(&quot;Error on start&quot;);                     return null;                 }             }             \/\/ \u0418\u0449\u0435\u043c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0443\u0433\u043b\u044b             else             {                 var last = newC[newC.Count - 1];                 if (parallelX)                 {                     if (ScanRight(ref oldC, ref newC, last.x, last.y, maxX))                     {                         parallelX = false;                         continue;                     }                     if (ScanLeft(ref oldC, ref newC, last.x, last.y, minX))                     {                         parallelX = false;                         continue;                     }                 }                 else                 {                     if (ScanUp(ref oldC, ref newC, last.x, last.y, maxY))                     {                         parallelX = true;                         continue;                     }                     if (ScanDown(ref oldC, ref newC, last.x, last.y, minY))                     {                         parallelX = true;                         continue;                     }                 }                 Debug.Log(&quot;Error -------------------------------------------------&quot;);                 Debug.Log(&quot;Corners: &quot; + corners.Count);                 Debug.Log(&quot;OldC: &quot; + oldC.Count);                 Debug.Log(&quot;NewC: &quot; + newC.Count);                 Debug.Log(last);                 color = Color.red;                 return last;             }         }         \/\/ \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0439\u0441\u044f \u0443\u0433\u043e\u043b         newC.Add(oldC[0]);         corners = newC;         return null;     }      bool ScanLeft(ref List&lt;GridVector&gt; oldC, ref List&lt;GridVector&gt; newC, int startX, int startY, int minX)     {         for (var x = startX; x &gt;= minX; x--)         {             var index = oldC.FindIndex(gv =&gt; gv.x == x && gv.y == startY);             if (index &gt; -1)             {                 newC.Add(oldC[index]);                 oldC.RemoveAt(index);                 return true;             }         }         return false;     }      bool ScanUp(ref List&lt;GridVector&gt; oldC, ref List&lt;GridVector&gt; newC, int startX, int startY, int maxY)     {         for (var y = startY; y &lt;= maxY; y++)         {             var index = oldC.FindIndex(gv =&gt; gv.x == startX && gv.y == y);             if (index &gt; -1)             {                 newC.Add(oldC[index]);                 oldC.RemoveAt(index);                 return true;             }         }         return false;     }      bool ScanRight(ref List&lt;GridVector&gt; oldC, ref List&lt;GridVector&gt; newC, int startX, int startY, int maxX)     {         for (var x = startX; x &lt;= maxX; x++)         {             var index = oldC.FindIndex(gv =&gt; gv.x == x && gv.y == startY);             if (index &gt; -1)             {                 newC.Add(oldC[index]);                 oldC.RemoveAt(index);                 return true;             }         }         return false;     }      bool ScanDown(ref List&lt;GridVector&gt; oldC, ref List&lt;GridVector&gt; newC, int startX, int startY, int minY)     {         for (var y = startY; y &gt;= minY; y--)         {             var index = oldC.FindIndex(gv =&gt; gv.x == startX && gv.y == y);             if (index &gt; -1)             {                 newC.Add(oldC[index]);                 oldC.RemoveAt(index);                 return true;             }         }         return false;     } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <img decoding=\"async\" align=\"left\" src=\"http:\/\/habrastorage.org\/storage3\/c2c\/dba\/8cd\/c2cdba8cd6b387e285aa01e6aad30914.png\"\/><br \/>  \u0412 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0438\u0442\u043e\u0433\u0435, \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0441\u043f\u0438\u0441\u043e\u043a \u0443\u0433\u043b\u043e\u0432, \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0447\u0430\u0441\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0435\u043b\u043a\u0435, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0441\u0442\u0435\u043d\u044b. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043b\u0435\u0433\u043a\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u043d\u0443 \u0432\u0430\u0436\u043d\u0443\u044e \u0432\u0435\u0449\u044c \u2014 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0430\u0440\u0443\u0436\u0443 \u043e\u0442 \u0441\u0442\u0435\u043d\u044b \u043a\u043e\u043c\u043d\u0430\u0442\u044b. \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043a\u043e\u043d\u0435\u0446 \u0441\u0442\u0435\u043d\u044b \u043d\u0430\u0440\u0443\u0436\u0443, \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c X \u0438 Y \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u0438 \u0438\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0432\u0443\u044e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0443, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435: (-y, x).<\/p>\n<p>  \u041a\u043e\u043c\u043d\u0430\u0442\u044b \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 \u0442\u043e\u0447\u0435\u043a, \u0442\u043e\u0447\u043a\u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f, \u0441\u0442\u0435\u043d\u044b \u0441\u0442\u0440\u043e\u044f\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0430\u0440\u0443\u0436\u0443 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e \u2014 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u043d\u0430 \u043f\u043b\u0430\u043d\u0435 \u044d\u0442\u0430\u0436\u0430 \u0438 \u0432\u044b\u0440\u0430\u0449\u0438\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u043d\u0430\u0442\u044b. \u0418\u043d\u043e\u0433\u0434\u0430 \u043f\u0440\u0430\u0432\u0434\u0430 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0441\u0442\u0435\u043d\u044b, \u043a\u043e\u0433\u0434\u0430 \u0441\u0442\u0430\u0440\u044b\u0435 \u0443\u0436\u0435 \u0432\u043e \u0447\u0442\u043e-\u0442\u043e \u0443\u043f\u0451\u0440\u043b\u0438\u0441\u044c \u0438 \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0441\u0442\u0438.<br \/>  <img decoding=\"async\" align=\"right\" src=\"http:\/\/habrastorage.org\/storage3\/bc4\/69a\/32a\/bc469a32a2c1d4730499a7248bb559c6.gif\"\/><br \/>  \u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u043a\u043b\u0435\u0442\u043e\u043a \u0438 \u043f\u043e\u0438\u0441\u043a\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043d\u043e\u0432\u044b\u0445 \u0441\u0442\u0435\u043d \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u043e\u0434\u043d\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0434\u043b\u044f \u0440\u043e\u0441\u0442\u0430 \u0443\u0447\u0430\u0441\u0442\u043a\u043e\u0432 \u043f\u043e\u0434\u0430\u0432\u0430\u0435\u043c\u043e\u0439 \u043d\u0430 \u0432\u0445\u043e\u0434 \u0441\u0442\u0435\u043d\u044b. \u041f\u043e\u0442\u043e\u043c \u044f \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u044e \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0435 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u044b \u0441\u043e \u0432\u0441\u0435\u0439 \u043a\u043e\u043c\u043d\u0430\u0442\u044b \u043f\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f\u043c: \u0446\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0442\u0435\u043d\u044b, \u043a\u0443\u0441\u043e\u0447\u043a\u0438 \u0443 \u043a\u0440\u0430\u044f \u0441\u0442\u0435\u043d\u044b, \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u044b. \u0412\u044b\u0431\u0438\u0440\u0430\u044e \u0441\u0430\u043c\u0443\u044e \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0441\u0442\u0435\u043d\u043a\u0443 \u0438\u0437 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0440\u043e\u0441\u0442\u0430 \u043a\u043e\u043c\u043d\u0430\u0442\u044b, \u0430 \u043e\u043d\u0430 \u0441\u0430\u043c\u0430 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f, \u0435\u0441\u0442\u044c \u0443 \u043d\u0435\u0451 \u0443\u0436\u0435 \u0442\u0430\u043a\u0430\u044f \u0441\u0442\u0435\u043d\u043a\u0430, \u0438\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e. \u041a\u043e\u0433\u0434\u0430 \u0441\u0442\u0435\u043d\u043a\u0430 \u0435\u0441\u0442\u044c, \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0435\u0451 \u043a\u043e\u043d\u0446\u043e\u0432 \u0441\u0434\u0432\u0438\u0433\u0430\u044e\u0442\u0441\u044f \u043d\u0430\u0440\u0443\u0436\u0443, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u0443\u0434\u043b\u0438\u043d\u0435\u043d\u0438\u044e \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0445 \u0441\u0442\u0435\u043d.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u0438\u0441\u043a \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u0442\u0435\u043d\u044b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">List&lt;RoomWall&gt; FindSegments(RoomWall wall, Color freeColor, Color roomColor)     {         var moved = wall + wall.outwards.minimized;         BresenhamLine(moved, new Color(Random.value * 0.7f + 0.1f, Random.value * 0.7f + 0.1f, Random.value * 0.7f + 0.1f), segmentsTexture);         var x0 = moved.start.x;         var y0 = moved.start.y;         var x1 = moved.end.x;         var y1 = moved.end.y;         var segments = new List&lt;RoomWall&gt;();         GridVector start = null;         GridVector end = null;          bool steep = Math.Abs(y1 - y0) &gt; Math.Abs(x1 - x0);         if (steep)         {             Swap(ref x0, ref y0);             Swap(ref x1, ref y1);         }         if (x0 &gt; x1)         {             Swap(ref x0, ref x1);             Swap(ref y0, ref y1);         }         for (int x = x0; x &lt;= x1; x++)         {             for (int y = y0; y &lt;= y1; y++)             {                 int coordX = steep ? y : x;                 int coordY = steep ? x : y;                 Color color = texture.GetPixel(coordX, coordY);                 if (color != freeColor && color != roomColor)                 {                     if (end != null && start != null)                     {                         var segment = new RoomWall(start, end);                         segment -= wall.outwards.minimized;                         segments.Add(segment);                         start = null;                         end = null;                     }                     scanTexture.SetPixel(coordX, coordY, Color.red);                 }                 else                 {                     if (start == null)                     {                         start = new GridVector(coordX, coordY);                     }                     end = new GridVector(coordX, coordY);                     scanTexture.SetPixel(coordX, coordY, Color.green);                 }             }         }         if (end != null && start != null)         {             var segment = new RoomWall(start, end);             segment -= wall.outwards.minimized;             segments.Add(segment);         }         return segments;     } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0439 \u0441 \u043a\u043e\u043c\u043d\u0430\u0442\u0430\u043c\u0438 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u0443, \u0432 \u043f\u0438\u043a\u0441\u0435\u043b\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0437\u0430\u043d\u043e\u0448\u0443 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441\u0442\u0435\u043d. \u0415\u0441\u043b\u0438 \u043d\u0435 \u0441\u0442\u0438\u0440\u0430\u0442\u044c \u0441\u0442\u0430\u0440\u044b\u0435 \u0441\u0442\u0435\u043d\u043a\u0438, \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u0438, \u043a\u0430\u043a \u043d\u0430 gif-\u043a\u0435 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u0442\u0430\u0442\u044c\u0438. \u0421\u0442\u0435\u043d\u044b \u0440\u0438\u0441\u0443\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043b\u0438\u043d\u0438\u0439 \u0411\u0440\u0435\u0437\u0435\u043d\u0445\u0435\u043c\u0430, \u043f\u0440\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u043f\u0438\u0441\u0430\u043b <a href=\"http:\/\/habrahabr.ru\/post\/185086\/\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441\u043e \u0441\u043a\u043b\u0435\u0439\u043a\u043e\u0439 \u0441\u0442\u0435\u043d, \u0432\u0441\u0451 \u0441\u0440\u0430\u0437\u0443 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0432\u0438\u0434\u043d\u043e. \u0412\u043c\u0435\u0441\u0442\u043e \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u044b \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0438\u043b\u0438 \u0441\u0440\u0430\u0437\u0443 \u043e\u043f\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0440\u0451\u0445\u043c\u0435\u0440\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u044c\u044e.<\/p>\n<p>  \u0412\u043d\u0435\u0448\u043d\u0438\u0435 \u0441\u0442\u0435\u043d\u044b \u043c\u043e\u0436\u043d\u043e \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e. \u0420\u0438\u0441\u0443\u0435\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0447\u0451\u0440\u043d\u044b\u0445 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432, \u0430 \u043f\u043e\u0432\u0435\u0440\u0445 \u043d\u0438\u0445 \u0440\u0438\u0441\u0443\u0435\u043c \u0442\u0430\u043a\u0438\u0435 \u0436\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0435\u043b\u044b\u0435 \u0438 \u043d\u0430 \u043e\u0434\u0438\u043d \u043f\u0438\u043a\u0441\u0435\u043b\u044c \u043c\u0435\u043d\u044c\u0448\u0435 \u0441 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043d\u044b\u0445 \u0434\u043e\u043c\u0438\u043a\u043e\u0432. \u0415\u0449\u0451 \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0440\u0451\u0445\u043c\u0435\u0440\u043d\u044b\u043c\u0438 \u0438 \u043f\u043e\u043a\u0440\u044b\u0442\u044c \u043a\u0440\u044b\u0448\u0435\u0439. <i>\u0413\u043e\u043b\u043e\u0441\u043e\u043c \u041a\u0430\u043d\u0435\u0432\u0441\u043a\u043e\u0433\u043e:<\/i> \u0412\u043f\u0440\u043e\u0447\u0435\u043c, \u044d\u0442\u043e \u0443\u0436\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0434\u0440\u0443\u0433\u0430\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u044f.<br \/>  <img decoding=\"async\" align=\"left\" src=\"http:\/\/habrastorage.org\/storage3\/17c\/850\/2db\/17c8502dbea82f006d4ca585fd163060.gif\"\/><br \/>  \u041f\u043e \u0441\u0441\u044b\u043b\u043a\u0430\u043c \u043d\u0438\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0438 \u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0433\u043e\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>  <a href=\"http:\/\/basmanovdaniil.github.io\/ProceduralExperiments\">Unity Web Player<\/a> | <a href=\"https:\/\/github.com\/BasmanovDaniil\/ProceduralExperiments\/releases\/download\/v0.1\/ProceduralExperiments.Windows.zip\">Windows<\/a> | <a href=\"https:\/\/github.com\/BasmanovDaniil\/ProceduralExperiments\/releases\/download\/v0.1\/ProceduralExperiments.Linux.zip\">Linux<\/a> | <a href=\"https:\/\/github.com\/BasmanovDaniil\/ProceduralExperiments\/releases\/download\/v0.1\/ProceduralExperiments.Mac.zip\">Mac<\/a> | <a href=\"https:\/\/github.com\/BasmanovDaniil\/ProceduralExperiments\">\u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u043d\u0430 GitHub<\/a><\/p>\n<p>  Shift \u2014 \u0421\u043e\u0437\u0434\u0430\u0451\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0441\u0442\u0435\u043d\u044b \u0441\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u043a\u043e\u043c\u043d\u0430\u0442\u0430\u043c\u0438<br \/>  Ctrl \u2014 \u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u0443 \u0441\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u043a\u043e\u043c\u043d\u0430\u0442\u0430\u043c\u0438<br \/>  Enter \u2014 \u0423\u0431\u0440\u0430\u0442\u044c \u0432\u0441\u0435 \u043a\u043e\u043c\u043d\u0430\u0442\u044b \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u0443<br \/>  \u041f\u0440\u043e\u0431\u0435\u043b \u2014 \u041e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0440\u043e\u0441\u0442 \u043a\u043e\u043c\u043d\u0430\u0442<br \/>  \u0415\u0434\u0438\u043d\u0438\u0446\u0430 \u043d\u0430 \u0430\u043b\u0444\u0430\u0432\u0438\u0442\u043d\u043e\u0439 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u0435 \u2014 \u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u043e\u0438\u0441\u043a\u0430 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445 \u043a\u043b\u0435\u0442\u043e\u043a<br \/>  \u041b\u0435\u0432\u0430\u044f \u043a\u043d\u043e\u043f\u043a\u0430 \u043c\u044b\u0448\u0438 \u043d\u0430 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u2014 \u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043c\u043d\u0430\u0442\u0443<br \/>  Esc \u2014 \u0412\u044b\u0445\u043e\u0434<\/p>\n<p>  \u0414\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 Linux: \u0421\u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u0444\u0430\u0439\u043b ProceduralExperiments.x86 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u00abchmod +x ProceduralExperiments.x86\u00bb \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0439\u0442\u0435.    \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\/184818\/\"> http:\/\/habrahabr.ru\/post\/184818\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" align=\"left\" src=\"http:\/\/habrastorage.org\/storage3\/7d8\/baf\/7ab\/7d8baf7ab46d91e6ef1e8f000823b74e.gif\"\/><br \/>  \u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043a\u0440\u0443\u043f\u043d\u044b\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u0433\u0440, \u043a\u043e\u0433\u0434\u0430 \u0435\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0441\u0442\u0440\u044f\u043f\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043c\u0435\u0449\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043c\u0438\u0440\u0430? \u041d\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043a\u0443\u0447\u0443 \u0445\u0443\u0434\u043e\u0436\u043d\u0438\u043a\u043e\u0432. \u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043b\u0435\u043d\u0438\u0432\u044b\u0439\/\u0431\u0435\u0434\u043d\u044b\u0439\/\u043e\u0434\u0438\u043d\u043e\u043a\u0438\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u0433\u0440 \u0432 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438? \u041f\u0438\u0448\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u044b\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0437\u0430 \u043d\u0435\u0433\u043e \u0432\u0441\u044e \u0433\u0440\u044f\u0437\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443.<\/p>\n<p>  \u041f\u043e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u043e\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u043b\u0430\u043d\u043e\u0432 \u043f\u043e\u043c\u0435\u0449\u0435\u043d\u0438\u0439 \u0435\u0441\u0442\u044c <a href=\"http:\/\/arxiv.org\/pdf\/1211.5842.pdf\">\u043c\u043d\u043e\u0433\u043e<\/a>, <a href=\"http:\/\/cs.stanford.edu\/people\/eschkufz\/research\/a181-merrell.pdf\">\u043e\u0447\u0435\u043d\u044c<\/a> <a href=\"http:\/\/dspace.mit.edu\/bitstream\/handle\/1721.1\/45649\/399893067.pdf\">\u043c\u043d\u043e\u0433\u043e<\/a> <a href=\"https:\/\/dr.library.brocku.ca\/bitstream\/handle\/10464\/3409\/Brock_Flack_Robert_2011.pdf?sequence=1\">\u0441\u0442\u0430\u0442\u0435\u0439<\/a>. <a href=\"http:\/\/graphics.tudelft.nl\/~rval\/papers\/tutenel.tciaig11.pdf\">\u0412\u043e\u0442<\/a> <a href=\"http:\/\/rvsn.csail.mit.edu\/Pubs\/master_whiting_2006june_bmgwriteup.pdf\">\u0435\u0449\u0451<\/a> <a href=\"http:\/\/www.generativeart.com\/on\/cic\/GA2010\/2010_18.pdf\">\u043f\u044f\u0442\u043e\u043a<\/a> <a href=\"http:\/\/axon.cs.byu.edu\/Dan\/673\/papers\/martin.pdf\">\u0441\u0441\u044b\u043b\u043e\u043a<\/a> <a href=\"http:\/\/iv.csit.carleton.ca\/~awhitehe\/pubs\/SIGGRAPH2006.pdf\">\u043d\u0430<\/a> <a href=\"http:\/\/www.benbradley.com\/files\/picag.pdf\">\u0441\u0442\u0430\u0442\u044c\u0438<\/a>. \u0412\u043e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 \u043d\u0438 \u043a \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043d\u0438\u0445 \u043d\u0435\u0442.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u043d\u0430 Unity3d \u043e\u0434\u0438\u043d \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043c\u0435\u0442\u043e\u0434 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0445\u043e\u0440\u043e\u0448\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c \u0438 \u043b\u0435\u0433\u043a\u043e \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u0442\u0441\u044f. \u0421 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430\u043c\u0438 \u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u043c\u0438.  <\/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-184818","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/184818","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=184818"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/184818\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=184818"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=184818"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=184818"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}