{"id":1436,"date":"2015-08-09T23:53:32","date_gmt":"2015-08-09T22:53:32","guid":{"rendered":"http:\/\/phoenixgamedevelopment.com\/blog\/?p=1436"},"modified":"2015-08-13T22:36:42","modified_gmt":"2015-08-13T21:36:42","slug":"p-152-virtual-world-concept-update-43-chunked-levels-of-detail-using-quad-trees-part-12","status":"publish","type":"post","link":"https:\/\/phoenixgamedevelopment.com\/blog\/p-152-virtual-world-concept-update-43-chunked-levels-of-detail-using-quad-trees-part-12\/","title":{"rendered":"P-152: Virtual World Concept Update 43: Chunked Levels of Detail Using Quad Trees Part 12"},"content":{"rendered":"<p>I have decided on a new approach to the optimisation\/parsing problem with the quad tree. I will not use a grid, or a coordinate system in the conventional sense. I think that mapping and converting the coordinates into the right frames of reference would have been too unwieldy. Instead, I will use a simple distance-based system, where nodes within a certain distance from the player will be subdivided, and nodes outside that distance will not.<\/p>\n<p>However, the problem is that at the moment I only have actual vertices being generated at the bottom tier of the tree. Eventually, I will be implementing a level of detail system with a copy of the terrain at each tier, each with it&#8217;s own vertices (with each tier being more complex than the previous one). At the moment though, I am only generating vertices on the bottom tier, with no LOD, for prototyping purposes.<\/p>\n<p>What I intend to do is develop an algorithm to start from the final tier, and get the exact center of the four nodes in that tier, then, set the node position of the previous tier to that center point. I can then do the same with the tier before that, and so on, all the way up. This should generate a full quad tree, where each node has approximate position information that I can use to compare the players position against. If the player is close enough to the node, I will subdivide it, otherwise, I don&#8217;t need to. Once I get down to the lower tiers, I can subdivide and include multiple nodes, \u00a0which should allow me to render everything surrounding the player.<\/p>\n<p>I am somewhat confident that this will work, but I won&#8217;t know for sure until I implement it.<\/p>\n<p>I have also added code to print out the entire quad tree, which was actually relatively complex, due to the recursive nature of the quad tree, but I needed this information to conduct proper debugging.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have decided on a new approach to the optimisation\/parsing problem with the quad tree. I will not use a grid, or a coordinate system in the conventional sense. I think that mapping and converting the coordinates into the right frames of reference would have been too unwieldy. Instead, I will use a simple distance-based [&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-1436","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\/1436"}],"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=1436"}],"version-history":[{"count":4,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/1436\/revisions"}],"predecessor-version":[{"id":1450,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/1436\/revisions\/1450"}],"wp:attachment":[{"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/media?parent=1436"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/categories?post=1436"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/tags?post=1436"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}