{"id":239,"date":"2009-07-28T00:07:16","date_gmt":"2009-07-27T23:07:16","guid":{"rendered":"http:\/\/www.codingfriends.com\/index.php\/2d3d-game\/"},"modified":"2009-07-29T12:37:14","modified_gmt":"2009-07-29T11:37:14","slug":"3dgame","status":"publish","type":"page","link":"https:\/\/www.codingfriends.com\/index.php\/projects\/3dgame\/","title":{"rendered":"2D\/3D &#8211; Game"},"content":{"rendered":"<p>I am currently working on learning and developing a 2D\/3D game.  The 3D game look will be something like that of FPS (First Person Shooter) e.g. KingPin, Unreal Tourment, but the first game will be a 2D game scrolling game.<\/p>\n<p>I am in the learning process of openGL and SDL\t<\/p>\n<ul>\n<li><a href=\"http:\/\/www.opengl.org\/\" target=\"_blank\">OpenGL<\/a><\/li>\n<li><a href=\"http:\/\/www.libsdl.org\/index.php\" target=\"_blank\">SDL (Simple DirectMedia Library)<\/a><\/li>\n<\/ul>\n<p>This is a demonstration of some aspects of OpenGL and SDL that I have learned. I shall be updating the demonstration probably on a weekly basis.<\/p>\n<ul>\n<li><a href=\"#test1\">Test 1 = Inner Solar System<\/a><\/li>\n<li><a href=\"#test2\">Test 2 = Room\/Street<\/a><\/li>\n<li><a href=\"#test3\">Test 3 = Stars<\/a><\/li>\n<li><a href=\"#test4\">Test 4 &#8211; Octree&#8217;s<\/a><\/li>\n<\/ul>\n<p> <a name=\"test1\"><strong>Inner Solar System<\/strong><\/a><\/p>\n<p>The movement has been implemented so that the mouse moves the screen center point, with the mouse left\/right button moving the eye\t position backwards\/forwarding accordlying.<\/p>\n<p><a href='http:\/\/www.codingfriends.com\/wp-content\/uploads\/2009\/07\/T1.zip'>Linux Download here (Binary)<\/a>\t <\/p>\n<p><small>I shall include the source code once I have got it in a nice format<\/small><\/p>\n<p>   This is a screen shot of the demostration<br \/><figure id=\"attachment_242\" aria-describedby=\"caption-attachment-242\" style=\"width: 518px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.codingfriends.com\/wp-content\/uploads\/2009\/07\/sdlt1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.codingfriends.com\/wp-content\/uploads\/2009\/07\/sdlt1.png\" alt=\"Inner Solar System (OpenGL + SDL)\" title=\"Inner Solar System (OpenGL + SDL)\" width=\"518\" height=\"242\" class=\"size-full wp-image-242\" srcset=\"https:\/\/www.codingfriends.com\/wp-content\/uploads\/2009\/07\/sdlt1.png 518w, https:\/\/www.codingfriends.com\/wp-content\/uploads\/2009\/07\/sdlt1-300x140.png 300w\" sizes=\"auto, (max-width: 518px) 100vw, 518px\" \/><\/a><figcaption id=\"caption-attachment-242\" class=\"wp-caption-text\">Inner Solar System (OpenGL + SDL)<\/figcaption><\/figure><\/p>\n<p>   <a name=\"test2\"><strong>Room\/Street<\/strong><\/a><\/p>\n<p>This is a demostration of a 3D room, with the same movement with the mouse as above.  At the minute there is only a room, but I shall be implementing a street and also collision detection.<\/p>\n<p>   <a href='http:\/\/www.codingfriends.com\/wp-content\/uploads\/2009\/07\/RoomT1.zip'>Linux Download here (Binary)<\/a><\/p>\n<p> <small>I shall include the source code once I have got it in a nice format<\/small><\/p>\n<p>This is a screen shot of the Room\/Street, the top left part of the image is the room from the outside with the rest of the picture the inside of the room.<br \/>\t    <figure id=\"attachment_246\" aria-describedby=\"caption-attachment-246\" style=\"width: 400px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.codingfriends.com\/wp-content\/uploads\/2009\/07\/RoomTest1.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.codingfriends.com\/wp-content\/uploads\/2009\/07\/RoomTest1.jpg\" alt=\"Room test (OpenGL + SDL)\" title=\"Room test (OpenGL + SDL)\" width=\"400\" height=\"311\" class=\"size-full wp-image-246\" srcset=\"https:\/\/www.codingfriends.com\/wp-content\/uploads\/2009\/07\/RoomTest1.jpg 400w, https:\/\/www.codingfriends.com\/wp-content\/uploads\/2009\/07\/RoomTest1-300x233.jpg 300w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/a><figcaption id=\"caption-attachment-246\" class=\"wp-caption-text\">Room test (OpenGL + SDL)<\/figcaption><\/figure><\/p>\n<p><a name=\"test3\"><strong>Stars<\/strong><\/a><\/p>\n<p>This demonstration of stars is a test to see how to get the <a href=\"http:\/\/en.wikipedia.org\/wiki\/Frustuml\" target=\"_blank\">frustum<\/a> rule to work.  The frustum rule is that you are looking at through the top of a pyramid, this allows only the details that you can see are sent to the graphics card, thus allowing for speed increase.<\/p>\n<p>The screen shot of the stars demostartion is just basically stars of different colours on a black backdrop.  So could not see a reason for displaying this.<br \/>\n\t  \t<a href='http:\/\/www.codingfriends.com\/wp-content\/uploads\/2009\/07\/openglstarstest.tar.bz2'>Linux source download with KDevelop files<\/a><br \/>\n\t\t<a href='http:\/\/www.codingfriends.com\/wp-content\/uploads\/2009\/07\/opengltest_SDL'>Linux Download here (Binary)<\/a><\/p>\n<p><a name=\"test4\"><strong>Octree&#8217;s<\/strong><\/a><\/p>\n<p>A basic definition of the Octree idea is <a href=\"http:\/\/hpcc.engin.umich.edu\/CFD\/users\/charlton\/Thesis\/html\/node29.html\" target=\"_blank\">here<\/a><\/p>\n<figure id=\"attachment_247\" aria-describedby=\"caption-attachment-247\" style=\"width: 414px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.codingfriends.com\/wp-content\/uploads\/2009\/07\/octree2.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.codingfriends.com\/wp-content\/uploads\/2009\/07\/octree2.png\" alt=\"Octree (OpenGL + SDL)\" title=\"Octree (OpenGL + SDL)\" width=\"414\" height=\"217\" class=\"size-full wp-image-247\" srcset=\"https:\/\/www.codingfriends.com\/wp-content\/uploads\/2009\/07\/octree2.png 414w, https:\/\/www.codingfriends.com\/wp-content\/uploads\/2009\/07\/octree2-300x157.png 300w\" sizes=\"auto, (max-width: 414px) 100vw, 414px\" \/><\/a><figcaption id=\"caption-attachment-247\" class=\"wp-caption-text\">Octree (OpenGL + SDL)<\/figcaption><\/figure>\n<p>The basic idea of Octree&#8217;s is to free up the bus to the graphics card.  This is achieved with only sending data that is in view (with the <a href=\"http:\/\/mathworld.wolfram.com\/PyramidalFrustum.html\" target=\"_blank\">frustum<\/a> law above) but instead of checking every point inside the 3d area, split the 3d area into blocks of 8 (octree&#8217;s) and only test if any of the 8 blocks are in view and thus send the data that is associated with the viewable blocks to the graphics card.<\/p>\n<p>\t\t<a href='http:\/\/www.codingfriends.com\/wp-content\/uploads\/2009\/07\/octree.zip'>Linux exectable (Binary)<\/a><br \/>\n\t\t<a href='http:\/\/www.codingfriends.com\/wp-content\/uploads\/2009\/07\/octree_source.zip'>Linux source code (KDevelop files)<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am currently working on learning and developing a 2D\/3D game. The 3D game look will be something like that of FPS (First Person Shooter) e.g. KingPin, Unreal Tourment, but the first game will be a 2D game scrolling game. I am in the learning process of openGL and SDL OpenGL SDL (Simple DirectMedia Library) &hellip; <a href=\"https:\/\/www.codingfriends.com\/index.php\/projects\/3dgame\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">2D\/3D &#8211; Game<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":34,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-239","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/pages\/239","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/comments?post=239"}],"version-history":[{"count":12,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/pages\/239\/revisions"}],"predecessor-version":[{"id":243,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/pages\/239\/revisions\/243"}],"up":[{"embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/pages\/34"}],"wp:attachment":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/media?parent=239"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}