{"id":1813,"date":"2015-11-01T23:57:51","date_gmt":"2015-11-01T23:57:51","guid":{"rendered":"http:\/\/phoenixgamedevelopment.com\/blog\/?p=1813"},"modified":"2015-11-02T16:58:43","modified_gmt":"2015-11-02T16:58:43","slug":"p-152-virtual-world-concept-update-62-chunked-levels-of-detail-using-quad-trees-part-30","status":"publish","type":"post","link":"https:\/\/phoenixgamedevelopment.com\/blog\/p-152-virtual-world-concept-update-62-chunked-levels-of-detail-using-quad-trees-part-30\/","title":{"rendered":"P-152: Virtual World Concept Update 63: Chunked Levels of Detail Using Quad Trees Part 31"},"content":{"rendered":"<p>I have succeeded in drawing my first quad!<\/p>\n<p>This may seem like a trivial matter, but it took considerable effort to get this far. In addition to the extensive modification and bug fixes that I wrote about before, I also had to modify the entire algorithm that creates the data points, to ensure they are compatible with the new system.<\/p>\n<p>I eventually arrived at a situation where I had four points for each node that I wanted to render, which is what I wanted. I then needed to render these four points as a quad, which I assumed would be a simple task.<\/p>\n<p>In actual fact, it turned out to be quite complex. Everything in computer graphics in rendered with triangles, which require three points. So, to render a quad using two triangles, I would need six points, not four, with two points being reused.<\/p>\n<p>I looked into a few different ways of solving this problem, including using GFXTriangleLists as a rendering method, and using an index\/primitive buffer.<\/p>\n<p>I am confident that the index buffer idea would have worked, but it would have required even more changes to the codebase to implement that. I decided for now to just create four points, as normal, then, when I am loading the points into the quad tree node, I will duplicate two of them, so I will have six points stored per node instead of 4. During rendering, I should then be able to draw those six points as two triangles.<\/p>\n<p>I don&#8217;t know if this is going to work yet, but I am reasonably confident.<\/p>\n<p>There is still a lot of work to be done on this, but I feel I am making significant progress.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1803\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/11\/PhoenixGameDevelopment251-Oct.-31-22.49-300x233.jpg\" alt=\"PhoenixGameDevelopment251 Oct. 31 22.49\" width=\"300\" height=\"233\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/11\/PhoenixGameDevelopment251-Oct.-31-22.49-300x233.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/11\/PhoenixGameDevelopment251-Oct.-31-22.49-1024x794.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/11\/PhoenixGameDevelopment251-Oct.-31-22.49.jpg 1040w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1804\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/11\/PhoenixGameDevelopment250-Oct.-31-22.47-300x233.jpg\" alt=\"PhoenixGameDevelopment250 Oct. 31 22.47\" width=\"300\" height=\"233\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/11\/PhoenixGameDevelopment250-Oct.-31-22.47-300x233.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/11\/PhoenixGameDevelopment250-Oct.-31-22.47-1024x794.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/11\/PhoenixGameDevelopment250-Oct.-31-22.47.jpg 1040w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1805\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/11\/PhoenixGameDevelopment248-Oct.-31-22.35-300x233.jpg\" alt=\"PhoenixGameDevelopment248 Oct. 31 22.35\" width=\"300\" height=\"233\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/11\/PhoenixGameDevelopment248-Oct.-31-22.35-300x233.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/11\/PhoenixGameDevelopment248-Oct.-31-22.35-1024x794.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/11\/PhoenixGameDevelopment248-Oct.-31-22.35.jpg 1040w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1806\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/11\/PhoenixGameDevelopment254-Oct.-31-23.47-300x233.jpg\" alt=\"PhoenixGameDevelopment254 Oct. 31 23.47\" width=\"300\" height=\"233\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/11\/PhoenixGameDevelopment254-Oct.-31-23.47-300x233.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/11\/PhoenixGameDevelopment254-Oct.-31-23.47-1024x794.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/11\/PhoenixGameDevelopment254-Oct.-31-23.47.jpg 1040w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><a href=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment223-Oct.-31-00.25.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1796\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment223-Oct.-31-00.25-300x233.jpg\" alt=\"PhoenixGameDevelopment223 Oct. 31 00.25\" width=\"300\" height=\"233\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment223-Oct.-31-00.25-300x233.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment223-Oct.-31-00.25-1024x794.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment223-Oct.-31-00.25.jpg 1040w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a> <a href=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment226-Oct.-31-00.29.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1797\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment226-Oct.-31-00.29-300x233.jpg\" alt=\"PhoenixGameDevelopment226 Oct. 31 00.29\" width=\"300\" height=\"233\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment226-Oct.-31-00.29-300x233.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment226-Oct.-31-00.29-1024x794.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment226-Oct.-31-00.29.jpg 1040w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a> <a href=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment231-Oct.-31-02.21.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1798\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment231-Oct.-31-02.21-300x233.jpg\" alt=\"PhoenixGameDevelopment231 Oct. 31 02.21\" width=\"300\" height=\"233\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment231-Oct.-31-02.21-300x233.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment231-Oct.-31-02.21-1024x794.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment231-Oct.-31-02.21.jpg 1040w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a> <a href=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment235-Oct.-31-02.46.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1799\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment235-Oct.-31-02.46-300x233.jpg\" alt=\"PhoenixGameDevelopment235 Oct. 31 02.46\" width=\"300\" height=\"233\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment235-Oct.-31-02.46-300x233.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment235-Oct.-31-02.46-1024x794.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment235-Oct.-31-02.46.jpg 1040w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a> <a href=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment233-Oct.-31-02.43.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1800\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment233-Oct.-31-02.43-300x158.jpg\" alt=\"PhoenixGameDevelopment233 Oct. 31 02.43\" width=\"300\" height=\"158\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment233-Oct.-31-02.43-300x158.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment233-Oct.-31-02.43-1024x540.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment233-Oct.-31-02.43.jpg 1440w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a> <a href=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment237-Oct.-31-02.47.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1801\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment237-Oct.-31-02.47-300x233.jpg\" alt=\"PhoenixGameDevelopment237 Oct. 31 02.47\" width=\"300\" height=\"233\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment237-Oct.-31-02.47-300x233.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment237-Oct.-31-02.47-1024x794.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment237-Oct.-31-02.47.jpg 1040w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a> <a href=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/11\/PhoenixGameDevelopment253-Oct.-31-23.25.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1802\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/11\/PhoenixGameDevelopment253-Oct.-31-23.25-300x168.jpg\" alt=\"PhoenixGameDevelopment253 Oct. 31 23.25\" width=\"300\" height=\"168\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/11\/PhoenixGameDevelopment253-Oct.-31-23.25-300x168.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/11\/PhoenixGameDevelopment253-Oct.-31-23.25-1024x574.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/11\/PhoenixGameDevelopment253-Oct.-31-23.25.jpg 1884w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have succeeded in drawing my first quad! This may seem like a trivial matter, but it took considerable effort to get this far. In addition to the extensive modification and bug fixes that I wrote about before, I also had to modify the entire algorithm that creates the data points, to ensure they are [&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-1813","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\/1813"}],"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=1813"}],"version-history":[{"count":5,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/1813\/revisions"}],"predecessor-version":[{"id":1826,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/1813\/revisions\/1826"}],"wp:attachment":[{"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/media?parent=1813"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/categories?post=1813"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/tags?post=1813"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}