{"id":15426,"date":"2015-06-16T05:01:49","date_gmt":"2015-06-15T19:01:49","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=15426"},"modified":"2015-06-16T10:16:23","modified_gmt":"2015-06-16T00:16:23","slug":"c-opengl-in-xcode-hexagonal-prism-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/c-opengl-in-xcode-hexagonal-prism-tutorial\/","title":{"rendered":"C++ OpenGL in Xcode Hexagonal Prism Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/OpenGL\/OpenGL-83of.jpg\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"C++ OpenGL in Xcode Hexagonal Prism Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/Mac\/OpenGL\/OpenGL-83of.jpg\" title=\"C++ OpenGL in Xcode Hexagonal Prism Tutorial\"  style=\"float:left;\" id='qpwo' onmouseover=\" this.src=this.src.replace('-83of.j','-81of.xj').replace('-81of.j','-82of.xj').replace('-82of.j','-83of.xj').replace('.x','.');   \" \/><\/a><p class=\"wp-caption-text\">C++ OpenGL in Xcode Hexagonal Prism Tutorial<\/p><\/div>\n<p>People think differently.<\/p>\n<p>People have reverence for different things.<\/p>\n<p>Some people do not like generalizations (&#8220;bye for now&#8221;).<\/p>\n<p>We like &#8230;<\/p>\n<ul>\n<li>associations<\/li>\n<li>linkages<\/li>\n<li>patterns<\/li>\n<li>creeping up on knowledge, especially if the subject matter is difficult<\/li>\n<\/ul>\n<p> &#8230; and so we proceed, on our quest, learning OpenGL &#8230; yesterday we drew a cube &#8230; yay!! &#8230; today a hexagonal prism &#8230; yayyyyyy!! &#8230; except those of you disappointed &#8230; why no genericity yet?! &#8230; and we say &#8230;<\/p>\n<blockquote><p>\nWe&#8217;re &#8220;creeping up on knowledge&#8221; &#8230; sssshhhhhh\n<\/p><\/blockquote>\n<p> &#8230; and we&#8217;re aiming for some generic principles we can use with WebGL by looking at associations, linkages and patterns that we see (or get help from the web, seeing).<\/p>\n<p>So the great place that helped today was from <a target=_blank title='Indiana State University Maths and Computing Department ... thanks' href='http:\/\/mathcs.indstate.edu\/dept\/'>Indiana State University Maths and Computing Department<\/a> &#8230; thanks for being so public with your brilliance.<\/p>\n<p>This all being said, a large part of what this blog&#8217;s philosophy, concerning &#8220;learning&#8221;, <i><b>involves revolves<\/b><\/i> around (we hope) &#8230;<\/p>\n<ul>\n<li>self reliance (in an OpenSource world)<\/li>\n<li>being curious (about all publicly available software solutions)<\/li>\n<li>knowing how to look for information<\/li>\n<li>knowing where to look for information (we try to help, but this touches on &#8220;artistry&#8221;)<\/li>\n<\/ul>\n<p> &#8230; and knowing when something requires deep understanding, you know when to say &#8230; &#8220;I need to enroll in a course to get full understanding here&#8221; &#8230; else &#8230; we say there are a lot of things you can teach yourself.<\/p>\n<p>So the crux of the matter is, if you are on the same OpenGL quest as we are at the moment, go zooming ahead with your understanding should going from a &#8220;cube&#8221; to a &#8220;hexagonal prism&#8221; (with your OpenGL ideas today) give you enough clues, or take a look at <a target=_blank title='Next lead ... thanks' href='http:\/\/mathforum.org\/dr.math\/faq\/formulas\/faq.regpoly.html'>the information we intend to peruse next<\/a>, or enroll in a course, or look up more yourself with all those great &#8220;search&#8221; resources (eg. search engines) that exist on the World Wide Web.<\/p>\n<p>Have a look at the C++ programming source code you could call <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/OpenGL\/main.cpp--GETME\" title=\"main.cpp\">main.cpp<\/a> of today.<\/p>\n<p>The C++ code above changed from yesterday as per <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/Mac\/OpenGL\/main.cpp--GETME\" title=\"main.cpp\">main.cpp<\/a> of today.<\/p>\n<p>Another &#8220;take home&#8221; from today&#8217;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/OpenGL\/OpenGL-83of.jpg\" title='Click picture'>tutorial<\/a> may be that an IDE-style run of the C++ today in Xcode can still make use of command line arguments as per the image below, snapshotted after Product-&gt;Scheme-&gt;Edit Scheme&#8230; <\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.rjmprogramming.com.au\/Mac\/OpenGL\/OpenGL-81of.jpg\" title='Xcode command line arguments idea'><\/img><\/p>\n<p><b><i>Word of the day<\/i><\/b><\/p>\n<p><a target=_blank title='Apothem information from Wikipedia' href='http:\/\/en.wikipedia.org\/wiki\/Apothem'>Apothem<\/a><\/p>\n<hr>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank  href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/OpenGL\/OpenGL-70of.jpg\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"C++ OpenGL in Xcode Follow Up Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/Mac\/OpenGL\/OpenGL-70of.jpg\" title=\"C++ OpenGL in Xcode Follow Up Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">C++ OpenGL in Xcode Follow Up Tutorial<\/p><\/div>\n<p><a target=_blank title='OpenGL information from Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/OpenGL'>OpenGL<\/a> has a <a target=_blank title='OpenGL landing page' href='http:\/\/OpenGL.org'>OpenGL.org<\/a> landing page which will talk about all the platforms supported, and let&#8217;s just remind you about the purpose, with a quote from the webpage &#8230;<\/p>\n<blockquote><p>\nThe Industry&#8217;s Foundation for High Performance Graphics<br \/>\nfrom games to virtual reality, mobile phones to supercomputers\n<\/p><\/blockquote>\n<p> &#8230; in other words, it is a <font size=7 color='red'>big<\/font> topic area, and we are chipping away at it.<\/p>\n<p>Yesterday, we concentrated on the install, and if you are new to something, this is often exhausting enough in itself.  Today we creep up on some of the concepts to representing a 3D object in a graphical way.  Some of the concepts we see are &#8230;<\/p>\n<ul>\n<li>object vertices definition<\/li>\n<li>object colour<\/li>\n<li>lighting &#8230; direction, type, angle, numbers of sources etcetera<\/li>\n<li>perspective &#8230; field of view, aspect ratio, Z position<\/li>\n<\/ul>\n<p> &#8230; with the help of the OpenSource brilliance of the following links &#8230;<\/p>\n<ul>\n<li><a target=_blank title='OpenGL real example coding ideas' href='https:\/\/www.opengl.org\/archives\/resources\/code\/samples\/glut_examples\/examples\/examples.html'>The link<\/a> has great software ideas for the code today &#8230; thanks &#8230; and thanks for the links below &#8230;<\/li>\n<li>Another <a target=_blank title='Another useful OpenGL link' href='https:\/\/www.cse.msu.edu\/~cse872\/tutorial3.html'>useful link<\/a><\/li>\n<\/ul>\n<p>Think, if you are following along with us here, the next best advice we have is to examine the code of the experts amalgamated into our C++ programming source code you could call <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/OpenGL\/main.cpp-GETME\" title=\"main.cpp\">main.cpp<\/a> of today.<\/p>\n<p>The C++ code above changed from yesterday as per <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/Mac\/OpenGL\/main.cpp-GETME\" title=\"main.cpp\">main.cpp<\/a> of today.<\/p>\n<p>Please take a careful look and <a target=_blank  href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/OpenGL\/OpenGL-70of.jpg\" title='Click picture'>learn<\/a>.  It&#8217;s all pretty amazing to me, as it has been for a very very very long time now.<\/p>\n<hr>\n<p id='coixpt'>Previous relevant <a target=_blank title='' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/c-opengl-in-xcode-primer-tutorial\/'>C++ OpenGL in Xcode Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank    href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/OpenGL\/\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"C++ OpenGL in Xcode Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/Mac\/OpenGL\/OpenGL-63of.jpg\" title=\"C++ OpenGL in Xcode Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">C++ OpenGL in Xcode Primer Tutorial<\/p><\/div>\n<p><a target=_blank title='OpenGL information from Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/OpenGL'>OpenGL<\/a> is, to quote from the <a target=_blank title='OpenGL landing page' href='http:\/\/OpenGL.org'>OpenGL.org<\/a> landing page &#8230;<\/p>\n<blockquote><p>\nThe Industry&#8217;s Foundation for High Performance Graphics<br \/>\nfrom games to virtual reality, mobile phones to supercomputers\n<\/p><\/blockquote>\n<p> &#8230; a big player for game developers for desktop, web, and mobile platforms.  Today (and please note we have this blog posting in a WordPress 4.1.1 website at <a target=_blank title='C++ OpenGL in Xcode Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/c-opengl-in-xcode-primer-tutorial\/'>C++ OpenGL in Xcode Primer Tutorial<\/a>) we are trying an install in a Mac OS X (Yosemite 10.10) environment using &#8230;<\/p>\n<ul>\n<li><a target=_blank title='MacPorts' href='https:\/\/www.macports.org\/install.php'>MacPorts<\/a> &#8230; to install &#8230;<\/li>\n<li>glew<\/li>\n<li>glut and freeglut<\/li>\n<\/ul>\n<p> &#8230; and the OpenSource brilliance of the following links &#8230;<\/p>\n<ul>\n<li><a target=_blank title='OpenGL coding ideas' href='http:\/\/duriansoftware.com\/joe\/An-intro-to-modern-OpenGL.-Chapter-2:-Hello-World:-The-Slideshow.html'>The link<\/a> has great software ideas for the code today &#8230; thanks &#8230; and thanks for the links below &#8230;<\/li>\n<li><a target=_blank title='glew' href='http:\/\/glew.sourceforge.net\/'>This link<\/a> has good information regarding The OpenGL Extension Wrangler Library<\/li>\n<li><a target=_blank title='Useful link regarding compilation of OpenGL application' href='http:\/\/lazyfoo.net\/tutorials\/OpenGL\/01_hello_opengl\/mac\/xcode\/index.php'>Useful link<\/a> talks about measures in Xcode to take to facilitate the compilation of the OpenGL application<\/li>\n<\/ul>\n<p> &#8230; to create a Mac OS X Xcode C++ project to create our Hello World scenarios for today&#8217;s tutorial.<\/p>\n<p>As you can see, there is so much more to learn with this subject area, and eventually feel that it will lead to some <a target=_blank title='WebGL' href='https:\/\/www.safaribooksonline.com\/library\/view\/webgl-up-and\/9781449326487\/ch01.html'>WebGL<\/a> work down the track for some 3D rendering on the HTML canvas element.<\/p>\n<p>If you enjoy such environments you may be very interested in researching <a target=_blank title='Tcl information from Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/Tcl'>Tcl\/Tk<\/a> in this subject area as well.<\/p>\n<p>Here is the C++ programming source code you could call <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/OpenGL\/main.cpp_GETME\" title=\"main.cpp\">main.cpp<\/a><\/p>\n<p>Onwards and upwards!  Hope you enjoy today&#8217;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/OpenGL\/\" title='Click picture'>tutorial<\/a>, which included a Mac Update of the Xcode Command Line tools, along the way.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d15398' onclick='var dv=document.getElementById(\"d15398\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/?tag=graphics\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d15398' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d15413' onclick='var dv=document.getElementById(\"d15413\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/?tag=xcode\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d15413' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d15426' onclick='var dv=document.getElementById(\"d15426\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/?tag=geometry\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d15426' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>People think differently. People have reverence for different things. Some people do not like generalizations (&#8220;bye for now&#8221;). We like &#8230; associations linkages patterns creeping up on knowledge, especially if the subject matter is difficult &#8230; and so we proceed, &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/c-opengl-in-xcode-hexagonal-prism-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,17,29,37,40],"tags":[1592,176,484,541,1591,1588,723,725,752,880,1589,997,1319,1473],"class_list":["post-15426","post","type-post","status-publish","format-standard","hentry","category-elearning","category-gui","category-operating-system","category-tutorials","category-xcode","tag-apothem","tag-c","tag-geometry","tag-graphics","tag-hexagonal-prism","tag-lighting","tag-mac","tag-mac-os-x","tag-mathematics","tag-opengl","tag-perspective","tag-programming","tag-tutorial","tag-xcode"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/15426"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=15426"}],"version-history":[{"count":6,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/15426\/revisions"}],"predecessor-version":[{"id":15436,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/15426\/revisions\/15436"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=15426"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=15426"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=15426"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}