{"id":1432,"date":"2015-08-02T21:26:41","date_gmt":"2015-08-02T20:26:41","guid":{"rendered":"http:\/\/phoenixgamedevelopment.com\/blog\/?p=1432"},"modified":"2015-08-02T21:26:41","modified_gmt":"2015-08-02T20:26:41","slug":"p-152-virtual-world-concept-update-42-chunked-levels-of-detail-using-quad-trees-part-11","status":"publish","type":"post","link":"https:\/\/phoenixgamedevelopment.com\/blog\/p-152-virtual-world-concept-update-42-chunked-levels-of-detail-using-quad-trees-part-11\/","title":{"rendered":"P-152: Virtual World Concept Update 42: Chunked Levels of Detail Using Quad Trees Part 11"},"content":{"rendered":"<p>I have made more progress on the quad tree implementation. I have modified the render function inside the spherical terrain code to read data from my optimisation algorithm. This algorithm isn&#8217;t implemented yet, at the moment it is just returning everything, with no culling or parsing, however the entire structure of the quadtree is now working.<\/p>\n<p>I am initialising the quadtree, then creating the spherical terrain and loading it into the quad tree, leaving as few empty spaces as possible. I am then adding the vertices of the spherical terrain to a render buffer during each render cycle, before drawing this render buffer to the scree.<\/p>\n<p>What I now need to do is implement a quad tree parsing algorithm which takes into account the players position, and only subdivides quad tree nodes close to that position.<\/p>\n<p>I was going to use a coordinate system for this, and translate the users world space position into a position on a simple two dimensional\u00a0grid. However, I have realised that since the terrain is spherical, I can&#8217;t use a two dimensional grid, as I had planned, I would need the third coordinate.<\/p>\n<p>I now intend to convert the object space coordinates of the spherical terrain into world space coordinates, and store these, as well as the resolution of each tier, in the quad tree. I can the compare the users position to the center of each node in world space, and use a simple distance check to include or exclude nodes.<\/p>\n<p>However, the issues here is that I may not have the world space coordinates of each tier, I will have to modify my algorithm to create those. I would also need an efficient way of converting from object space to world space.<\/p>\n<p>This should be the last issue that I have to deal with in implementing the basic terrain concept.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have made more progress on the quad tree implementation. I have modified the render function inside the spherical terrain code to read data from my optimisation algorithm. This algorithm isn&#8217;t implemented yet, at the moment it is just returning everything, with no culling or parsing, however the entire structure of the quadtree is now [&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,10,11],"tags":[],"class_list":["post-1432","post","type-post","status-publish","format-standard","hentry","category-astral-realms","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\/1432"}],"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=1432"}],"version-history":[{"count":1,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/1432\/revisions"}],"predecessor-version":[{"id":1433,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/1432\/revisions\/1433"}],"wp:attachment":[{"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/media?parent=1432"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/categories?post=1432"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/tags?post=1432"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}