{"id":144,"date":"2018-01-21T15:43:49","date_gmt":"2018-01-21T14:43:49","guid":{"rendered":"http:\/\/nicolas.laurent.re\/?p=144"},"modified":"2018-01-27T22:20:01","modified_gmt":"2018-01-27T21:20:01","slug":"generation-de-planete-low-poly","status":"publish","type":"post","link":"https:\/\/nicolas.laurent.re\/en\/2018\/01\/21\/generation-de-planete-low-poly\/","title":{"rendered":"Low poly planet generation"},"content":{"rendered":"<p>This low poly planet g\u00e9n\u00e9rator is a solo made project. It was destined to be used in an abandonned game project. I have developped it in C++, and used <a href=\"https:\/\/openclassrooms.com\/forum\/sujet\/moteur-de-jeu-nazara-engine-69732\" target=\"_blank\" rel=\"noopener\">Nazara engine<\/a> to make the render of the generated planets.<\/p>\n<p>To create this generator, i was greatly inspired by this article :<br \/>\n<a href=\"http:\/\/www-cs-students.stanford.edu\/~amitp\/game-programming\/polygon-map-generation\/\" target=\"_blank\" rel=\"noopener\">http:\/\/www-cs-students.stanford.edu\/~amitp\/game-programming\/polygon-map-generation\/<\/a><\/p>\n<p>The generation is made in several steps :<\/p>\n<ul>\n<li>Making an <a href=\"https:\/\/en.wikipedia.org\/wiki\/Icosphere\" target=\"_blank\" rel=\"noopener\">ICO<\/a> sphere rhar is used as base surface, and adding some data on each vertex (moisture, offset, biome &#8230;)<\/li>\n<li>Define a first vertex offsex with a 3D <a href=\"https:\/\/en.wikipedia.org\/wiki\/Perlin_noise\" target=\"_blank\" rel=\"noopener\">perlin noise<\/a>, that allow to define bounds between water and land.<\/li>\n<li>The small water area are lakes, and the bigests are ocean.<\/li>\n<li>The elevation is calculed on each vertex according to the distance to the edge of the nearest ocean while keeeping the lakes flat.<\/li>\n<li>WHen the relief is defined, it&#8217;s now possible to go down to the ocean from each vertex, by following the edges between each points. That&#8217;s how the rivers are drawn.<\/li>\n<li>The moisture level of a vertex is defined by his distance to the nearest river.<\/li>\n<li>When the moisture and the elevation are builds, the biome can be defined.<\/li>\n<\/ul>\n<p>With all theses informations given by the generator, it&#8217;s now possible to build the render of the planet, by giving a color to each biome.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-146 aligncenter\" src=\"http:\/\/nicolas.laurent.re\/wp-content\/uploads\/sites\/2\/2018\/01\/VoronoisPerlin3D_11.png\" alt=\"\" width=\"468\" height=\"480\" srcset=\"https:\/\/nicolas.laurent.re\/wp-content\/uploads\/sites\/2\/2018\/01\/VoronoisPerlin3D_11.png 468w, https:\/\/nicolas.laurent.re\/wp-content\/uploads\/sites\/2\/2018\/01\/VoronoisPerlin3D_11-293x300.png 293w\" sizes=\"auto, (max-width: 468px) 100vw, 468px\" \/><\/p>\n<p>You can found the project on github : <a href=\"https:\/\/github.com\/larnin\/PlanetGeneration\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/larnin\/PlanetGeneration<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This low poly planet g\u00e9n\u00e9rator is a solo made project. It was destined to be used in an abandonned game project. I have developped it in C++, and used Nazara engine to make the render of the generated planets. To create this generator, i was greatly inspired by this article : http:\/\/www-cs-students.stanford.edu\/~amitp\/game-programming\/polygon-map-generation\/ The generation is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":145,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-144","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-projects"],"jetpack_featured_media_url":"https:\/\/nicolas.laurent.re\/wp-content\/uploads\/sites\/2\/2018\/01\/Planete.png","_links":{"self":[{"href":"https:\/\/nicolas.laurent.re\/en\/wp-json\/wp\/v2\/posts\/144","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nicolas.laurent.re\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nicolas.laurent.re\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nicolas.laurent.re\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nicolas.laurent.re\/en\/wp-json\/wp\/v2\/comments?post=144"}],"version-history":[{"count":9,"href":"https:\/\/nicolas.laurent.re\/en\/wp-json\/wp\/v2\/posts\/144\/revisions"}],"predecessor-version":[{"id":244,"href":"https:\/\/nicolas.laurent.re\/en\/wp-json\/wp\/v2\/posts\/144\/revisions\/244"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nicolas.laurent.re\/en\/wp-json\/wp\/v2\/media\/145"}],"wp:attachment":[{"href":"https:\/\/nicolas.laurent.re\/en\/wp-json\/wp\/v2\/media?parent=144"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nicolas.laurent.re\/en\/wp-json\/wp\/v2\/categories?post=144"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nicolas.laurent.re\/en\/wp-json\/wp\/v2\/tags?post=144"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}