{"id":2190,"date":"2016-01-09T20:48:09","date_gmt":"2016-01-09T20:48:09","guid":{"rendered":"http:\/\/phoenixgamedevelopment.com\/blog\/?p=2190"},"modified":"2016-01-09T20:48:09","modified_gmt":"2016-01-09T20:48:09","slug":"p-152-virtual-world-concept-update-90-chunked-levels-of-detail-using-quad-trees-part-57","status":"publish","type":"post","link":"https:\/\/phoenixgamedevelopment.com\/blog\/p-152-virtual-world-concept-update-90-chunked-levels-of-detail-using-quad-trees-part-57\/","title":{"rendered":"P-152: Virtual World Concept Update 90: Chunked Levels of Detail Using Quad Trees Part 57"},"content":{"rendered":"<p>The level-order search algorithm seems to work fine, however, it did not fix the problem.<\/p>\n<p>After much research, I believe I know what the problem is.<\/p>\n<p>The quad tree part of the code may actually be working ok, the issue at the moment, I believe, is in generating the points in the correct order before feeding them to the quad tree.<\/p>\n<p>I was using a simple loop of i and j values, scaling them, and projecting them to a sphere. However, this produces a range of values which traverse the entire terrain grid, so, if the grid has a resolution of 256*256, the i value will increment from 0 to 255 and then be reset to 0, j will then increment to 1, and the next row will be processed.<\/p>\n<p>Since the quad tree is loaded in order from a list of points, this means that the quad tree is not being loaded with the correct points. I need to generate the points in the same order that the quad tree will be parsing them. So, I need to generate them in groups of 4. For example, for a resolution of 16 (4&#215;4) I need to render the points in 4 groups of 4.<\/p>\n<p>This is turning out to be very complex! I am having difficulty using a simple coordinate based system, and incrementing counters. I am also conscious of the fact that this system needs to work for all tiers, so for a resolution of 16 I need 4 groups of 4 nodes, but my solution needs to scale to a resolution of 64, 256, etc.<\/p>\n<p>If this works, I should be able to get proof of concept, and I can then decide how to proceed from there.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2195\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/01\/PhoenixAdvanced_06-Jan.-09-19.37-300x169.jpg\" alt=\"PhoenixAdvanced_06 Jan. 09 19.37\" width=\"300\" height=\"169\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/01\/PhoenixAdvanced_06-Jan.-09-19.37-300x169.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/01\/PhoenixAdvanced_06-Jan.-09-19.37-768x432.jpg 768w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/01\/PhoenixAdvanced_06-Jan.-09-19.37-1024x576.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/01\/PhoenixAdvanced_06-Jan.-09-19.37.jpg 1920w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2194\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/01\/PhoenixAdvanced_05-Jan.-09-16.12-300x169.jpg\" alt=\"PhoenixAdvanced_05 Jan. 09 16.12\" width=\"300\" height=\"169\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/01\/PhoenixAdvanced_05-Jan.-09-16.12-300x169.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/01\/PhoenixAdvanced_05-Jan.-09-16.12-768x432.jpg 768w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/01\/PhoenixAdvanced_05-Jan.-09-16.12-1024x576.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/01\/PhoenixAdvanced_05-Jan.-09-16.12.jpg 1920w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2193\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/01\/PhoenixAdvanced_04-Jan.-09-04.54-300x169.jpg\" alt=\"PhoenixAdvanced_04 Jan. 09 04.54\" width=\"300\" height=\"169\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/01\/PhoenixAdvanced_04-Jan.-09-04.54-300x169.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/01\/PhoenixAdvanced_04-Jan.-09-04.54-768x432.jpg 768w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/01\/PhoenixAdvanced_04-Jan.-09-04.54-1024x576.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/01\/PhoenixAdvanced_04-Jan.-09-04.54.jpg 1920w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2191\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/01\/PhoenixAdvanced_03-Jan.-09-02.55-300x169.jpg\" alt=\"PhoenixAdvanced_03 Jan. 09 02.55\" width=\"300\" height=\"169\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/01\/PhoenixAdvanced_03-Jan.-09-02.55-300x169.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/01\/PhoenixAdvanced_03-Jan.-09-02.55-768x432.jpg 768w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/01\/PhoenixAdvanced_03-Jan.-09-02.55-1024x576.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/01\/PhoenixAdvanced_03-Jan.-09-02.55.jpg 1920w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The level-order search algorithm seems to work fine, however, it did not fix the problem. After much research, I believe I know what the problem is. The quad tree part of the code may actually be working ok, the issue at the moment, I believe, is in generating the points in the correct order before [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,17,10,11],"tags":[],"class_list":["post-2190","post","type-post","status-publish","format-standard","hentry","category-astral-realms","category-p-0","category-software-and-games","category-spiritus-astrum","has-post-title","has-post-date","has-post-category","has-post-tag","has-post-comment","has-post-author",""],"aioseo_notices":[],"builder_content":"","_links":{"self":[{"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/2190"}],"collection":[{"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/comments?post=2190"}],"version-history":[{"count":3,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/2190\/revisions"}],"predecessor-version":[{"id":2197,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/2190\/revisions\/2197"}],"wp:attachment":[{"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/media?parent=2190"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/categories?post=2190"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/tags?post=2190"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}