Roi Atalla avatar Roi Atalla committed b328764

Example 17.3 fully ported. This concludes 10 months of arduous work porting Arcsynthesis tutorials!

Comments (0)

Files changed (24)

.idea/workspace.xml

 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
   <component name="ChangeListManager">
-    <list default="true" id="3bd3582b-975a-4915-888d-8e2c52d85938" name="Default" comment="Example 17.2 fully ported, fixed lighting issues.">
-      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/Example17_3.java" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter16/example3/Example16_3.java" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter16/example3/Example16_3.java" />
+    <list default="true" id="3bd3582b-975a-4915-888d-8e2c52d85938" name="Default" comment="Reformat + Example 17.3 skeleton.">
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.IrregularPoint.dds" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.Planetarium.dds" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.concrete649_small.dds" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.dsc_1621_small.dds" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.rough645_small.dds" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.seamless_rock1_small.dds" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.wood4_rotate.dds" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.Colored.frag" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.Colored.vert" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.LongBar.xml" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.ShortBar.xml" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.UnitAxes.xml" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.UnitCube.xml" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.UnitDiorama.xml" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.UnitPlane.xml" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.UnitSphere.xml" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.Unlit.frag" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.Unlit.vert" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.cubeLight.frag" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.cubeLight.vert" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.scene.xml" />
       <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/Example17_2.java" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/Example17_2.java" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/com/ra4king/opengl/util/scene/Scene.java" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/util/scene/Scene.java" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/com/ra4king/opengl/util/Utils.java" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/util/Utils.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/Example17_3.java" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/Example17_3.java" />
       <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
     </list>
     <ignored path="OpenGL.iws" />
     <file path="/a.xml" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1361850040520" ignored="false" />
     <file path="/a.html" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1361850041808" ignored="false" />
     <file path="/a.groovy" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1361850042481" ignored="false" />
-    <file path="/Dummy.txt" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992001807" ignored="false" />
+    <file path="/Dummy.txt" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1370076380550" ignored="false" />
     <file path="/Example12_1.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1362027020824" ignored="false" />
     <file path="/example12.1.DiffuseSpecular.frag" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1361702005810" ignored="false" />
     <file path="/LightManager.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1362461124226" ignored="false" />
     <file path="/example17.1.LitTexture.vert" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369806975413" ignored="false" />
     <file path="/example17.1.LitTexture.frag" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369905788025" ignored="false" />
     <file path="/example17.1.scene.xml" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369891097369" ignored="false" />
-    <file path="/Example17_2.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369991580787" ignored="false" />
+    <file path="/Example17_2.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1370075136788" ignored="false" />
     <file path="/example17.2.Colored.vert" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369905436267" ignored="false" />
     <file path="/example17.2.Colored.frag" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369905472067" ignored="false" />
     <file path="/example17.2.projLight.vert" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369990560376" ignored="false" />
     <file path="/example17.2.projLight.frag" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369990656776" ignored="false" />
-    <file path="/Example17_3.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369991980902" ignored="false" />
+    <file path="/Example17_3.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1370076817911" ignored="false" />
     <file path="$PROJECT_DIR$/src/com/ra4king/opengl/util/math/Matrix3.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042212" ignored="false" />
     <file path="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter13/example2/Example13_2.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042212" ignored="false" />
-    <file path="$PROJECT_DIR$/src/com/ra4king/opengl/util/math/Quaternion.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042212" ignored="false" />
     <file path="$PROJECT_DIR$/src/com/ra4king/opengl/util/math/Vector2.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042212" ignored="false" />
     <file path="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter10/example1/Example10_1.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042213" ignored="false" />
     <file path="$PROJECT_DIR$/src/com/ra4king/opengl/util/math/MatrixStack.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042212" ignored="false" />
     <file path="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter14/example1/Example14_1.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042212" ignored="false" />
     <file path="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter14/example2/Example14_2.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042212" ignored="false" />
     <file path="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example1/Example17_1.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042213" ignored="false" />
-    <file path="$PROJECT_DIR$/src/com/ra4king/opengl/util/scene/binders/StateBinder.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042213" ignored="false" />
     <file path="$PROJECT_DIR$/src/com/ra4king/opengl/util/scene/binders/TextureBinder.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042213" ignored="false" />
     <file path="$PROJECT_DIR$/src/com/ra4king/opengl/util/scene/binders/UniformBlockBinder.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042213" ignored="false" />
     <file path="$PROJECT_DIR$/src/com/ra4king/opengl/util/scene/binders/UniformFloatBinder.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042213" ignored="false" />
     <file path="$PROJECT_DIR$/src/com/ra4king/opengl/util/scene/binders/UniformIntBinder.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042213" ignored="false" />
-    <file path="$PROJECT_DIR$/src/com/ra4king/opengl/util/scene/binders/UniformMat4Binder.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042213" ignored="false" />
     <file path="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter14/example3/Example14_3.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042212" ignored="false" />
     <file path="$PROJECT_DIR$/src/com/ra4king/opengl/util/scene/binders/UniformVec2Binder.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042213" ignored="false" />
     <file path="$PROJECT_DIR$/src/com/ra4king/opengl/util/scene/binders/UniformVec3Binder.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042213" ignored="false" />
     <file path="$PROJECT_DIR$/src/com/ra4king/opengl/util/scene/binders/UniformVec4Binder.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042213" ignored="false" />
     <file path="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter15/Example15_1.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042212" ignored="false" />
     <file path="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter16/example1/Example16_1.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042212" ignored="false" />
-    <file path="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter16/example3/LightEnv.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042213" ignored="false" />
     <file path="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter11/example2/Example11_2.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042213" ignored="false" />
     <file path="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter16/example2/Example16_2.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042212" ignored="false" />
-    <file path="$PROJECT_DIR$/src/com/ra4king/opengl/util/math/Matrix4.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042213" ignored="false" />
     <file path="$PROJECT_DIR$/src/com/ra4king/opengl/util/Mesh.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042213" ignored="false" />
     <file path="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl32/chapter1/Example1_1.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042213" ignored="false" />
     <file path="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl32/chapter2/example1/Example2_1.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042213" ignored="false" />
     <file path="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter1/Example1_1.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042213" ignored="false" />
     <file path="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter13/example1/Example13_1.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042213" ignored="false" />
     <file path="$PROJECT_DIR$/src/com/ra4king/opengl/util/ShaderProgram.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042212" ignored="false" />
-    <file path="$PROJECT_DIR$/src/com/ra4king/opengl/util/Timer.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042212" ignored="false" />
     <file path="$PROJECT_DIR$/src/com/ra4king/opengl/util/PNGDecoder.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042212" ignored="false" />
     <file path="$PROJECT_DIR$/src/com/ra4king/opengl/util/MousePoles.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042212" ignored="false" />
     <file path="$PROJECT_DIR$/src/com/ra4king/opengl/util/StringUtil.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042212" ignored="false" />
     <file path="$PROJECT_DIR$/src/rosick/jglsdk/glimg/ImageFormat.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042212" ignored="false" />
     <file path="$PROJECT_DIR$/src/rosick/jglsdk/glimg/ImageSet.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042212" ignored="false" />
     <file path="$PROJECT_DIR$/src/rosick/jglsdk/glimg/ImageCreator.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042212" ignored="false" />
-    <file path="$PROJECT_DIR$/src/rosick/jglsdk/glimg/TextureGenerator.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042212" ignored="false" />
     <file path="$PROJECT_DIR$/src/rosick/jglsdk/glimg/DdsUtil.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042212" ignored="false" />
     <file path="$PROJECT_DIR$/src/rosick/jglsdk/glimg/DdsLoader.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992042213" ignored="false" />
+    <file path="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter16/example3/Example16_3.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369992074537" ignored="false" />
+    <file path="/example17.3.cubeLight.vert" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1370076276847" ignored="false" />
+    <file path="/example17.3.cubeLight.frag" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1370076338322" ignored="false" />
     <option name="TRACKING_ENABLED" value="true" />
     <option name="SHOW_DIALOG" value="true" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
     <disable_hints />
   </component>
   <component name="DebuggerManager">
-    <ui_properties default_suspend_policy="SuspendAll" default_condition_enabled="true" />
+    <line_breakpoints default_suspend_policy="SuspendAll" default_condition_enabled="true" />
     <breakpoint_any default_suspend_policy="SuspendAll" default_condition_enabled="true">
       <breakpoint>
         <option name="NOTIFY_CAUGHT" value="true" />
         <option name="LOG_MESSAGE" value="&#13;&#13;JAVA" />
       </breakpoint>
     </breakpoint_any>
-    <line_breakpoints default_suspend_policy="SuspendAll" default_condition_enabled="true">
-      <breakpoint url="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/Example17_2.java" line="309" class="com.ra4king.opengl.arcsynthesis.gl33.chapter17.example2.Example17_2" package="com.ra4king.opengl.arcsynthesis.gl33.chapter17.example2">
-        <option name="ENABLED" value="true" />
-        <option name="LOG_ENABLED" value="false" />
-        <option name="LOG_EXPRESSION_ENABLED" value="false" />
-        <option name="REMOVE_AFTER_HIT" value="false" />
-        <option name="SUSPEND_POLICY" value="SuspendAll" />
-        <option name="SUSPEND" value="true" />
-        <option name="COUNT_FILTER_ENABLED" value="false" />
-        <option name="COUNT_FILTER" value="0" />
-        <option name="CONDITION_ENABLED" value="true" />
-        <option name="CLASS_FILTERS_ENABLED" value="false" />
-        <option name="INSTANCE_FILTERS_ENABLED" value="false" />
-        <option name="CONDITION" value="" />
-        <option name="LOG_MESSAGE" value="" />
-      </breakpoint>
-    </line_breakpoints>
+    <ui_properties default_suspend_policy="SuspendAll" default_condition_enabled="true" />
     <breakpoint_rules />
     <ui_properties />
   </component>
     <favorites_list name="OpenGL" />
   </component>
   <component name="FileEditorManager">
-    <leaf />
+    <leaf>
+      <file leaf-file-name="Example17_3.java" pinned="false" current="true" current-in-tab="true">
+        <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/Example17_3.java">
+          <provider selected="true" editor-type-id="text-editor">
+            <state line="157" column="4" selection-start="4899" selection-end="4899" vertical-scroll-proportion="0.4275">
+              <folding>
+                <element signature="imports" expanded="true" />
+              </folding>
+            </state>
+          </provider>
+        </entry>
+      </file>
+      <file leaf-file-name="example17.3.cubeLight.frag" pinned="false" current="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.cubeLight.frag">
+          <provider selected="true" editor-type-id="text-editor">
+            <state line="33" column="64" selection-start="752" selection-end="752" vertical-scroll-proportion="0.0">
+              <folding />
+            </state>
+          </provider>
+        </entry>
+      </file>
+    </leaf>
   </component>
   <component name="FindManager">
     <FindUsagesManager>
   <component name="IdeDocumentHistory">
     <option name="changedFiles">
       <list>
-        <option value="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter14/example3/example14.3.UnitCube.xml" />
-        <option value="$PROJECT_DIR$/src/com/ra4king/opengl/util/Utils.java" />
-        <option value="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example1/Example17_1.java" />
         <option value="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example1/example17.1.UnitSphere.xml" />
         <option value="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.scene.xml" />
         <option value="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.UnitAxes.xml" />
         <option value="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter16/example1/Example16_1.java" />
         <option value="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.projLight.vert" />
         <option value="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.projLight.frag" />
+        <option value="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/Example17_2.java" />
+        <option value="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.scene.xml" />
+        <option value="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.cubeLight.vert" />
+        <option value="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.cubeLight.frag" />
         <option value="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/Example17_3.java" />
-        <option value="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/Example17_2.java" />
       </list>
     </option>
   </component>
     </navigator>
     <panes>
       <pane id="Scope" />
-      <pane id="PackagesPane">
-        <subPane />
-      </pane>
       <pane id="ProjectPane">
         <subPane>
           <PATH>
           </PATH>
         </subPane>
       </pane>
+      <pane id="PackagesPane">
+        <subPane />
+      </pane>
     </panes>
   </component>
   <component name="PropertiesComponent">
     <property name="project.structure.last.edited" value="Libraries" />
     <property name="project.structure.proportion" value="0.15" />
     <property name="options.splitter.main.proportions" value="0.3" />
+    <property name="recentsLimit" value="5" />
+    <property name="MemberChooser.sorted" value="false" />
     <property name="FileHistory.org.zmlx.hg4idea.provider.HgHistoryProvider_treeWidth1" value="285" />
-    <property name="MemberChooser.sorted" value="false" />
-    <property name="recentsLimit" value="5" />
     <property name="FileHistory.org.zmlx.hg4idea.provider.HgHistoryProvider_treeWidth2" value="292" />
     <property name="last_opened_file_path" value="$PROJECT_DIR$/../Test" />
     <property name="FileHistory.org.zmlx.hg4idea.provider.HgHistoryProvider_treeWidth0" value="296" />
     <property name="FileHistory.org.zmlx.hg4idea.provider.HgHistoryProvider_flatWidth0" value="292" />
     <property name="options.lastSelected" value="preferences.sourceCode.Java" />
     <property name="FileHistory.org.zmlx.hg4idea.provider.HgHistoryProvider_flatOrder1" value="1" />
+    <property name="FileHistory.org.zmlx.hg4idea.provider.HgHistoryProvider_flatOrder0" value="0" />
     <property name="project.structure.side.proportion" value="0.2" />
-    <property name="FileHistory.org.zmlx.hg4idea.provider.HgHistoryProvider_flatOrder0" value="0" />
     <property name="FileHistory.org.zmlx.hg4idea.provider.HgHistoryProvider_flatOrder3" value="3" />
+    <property name="FileHistory.org.zmlx.hg4idea.provider.HgHistoryProvider_flatOrder2" value="2" />
     <property name="MemberChooser.copyJavadoc" value="false" />
-    <property name="FileHistory.org.zmlx.hg4idea.provider.HgHistoryProvider_flatOrder2" value="2" />
     <property name="restartRequiresConfirmation" value="true" />
+    <property name="options.searchVisible" value="true" />
     <property name="dynamic.classpath" value="false" />
-    <property name="options.searchVisible" value="true" />
   </component>
   <component name="RecentsManager">
     <key name="CopyClassDialog.RECENTS_KEY">
       <recent name="com.ra4king.opengl.arcsynthesis.gl33.chapter12.example2" />
     </key>
     <key name="CopyFile.RECENT_KEYS">
+      <recent name="E:\Roi Atalla\Documents\Programming Files\Java Files\Personal Projects\OpenGL\src\com\ra4king\opengl\arcsynthesis\gl33\chapter17\example3" />
       <recent name="E:\Roi Atalla\Documents\Programming Files\Java Files\Personal Projects\OpenGL\src\com\ra4king\opengl\arcsynthesis\gl33\chapter17\example2" />
       <recent name="E:\Roi Atalla\Documents\Programming Files\Java Files\Personal Projects\OpenGL\src\com\ra4king\opengl\arcsynthesis\gl33\chapter17\example1" />
       <recent name="E:\Roi Atalla\Documents\Programming Files\Java Files\Personal Projects\OpenGL\src\com\ra4king\opengl\arcsynthesis\gl32" />
       <recent name="E:\Roi Atalla\Documents\Programming Files\Java Files\Personal Projects\OpenGL\files\natives" />
-      <recent name="E:\Roi Atalla\Documents\Programming Files\Java Files\Personal Projects\OpenGL\files" />
-    </key>
-    <key name="MoveFile.RECENT_KEYS">
-      <recent name="E:\Roi Atalla\Documents\Programming Files\Java Files\Personal Projects\OpenGL\src\com\ra4king\opengl\arcsynthesis\gl33\chapter17\example2" />
-      <recent name="E:\Roi Atalla\Documents\Programming Files\Java Files\Personal Projects\OpenGL\src\com\ra4king\opengl\arcsynthesis\gl33\chapter16\example3" />
-      <recent name="E:\Roi Atalla\Documents\Programming Files\Java Files\Personal Projects\OpenGL\src\com\ra4king\opengl\arcsynthesis\gl33\chapter16\example2" />
-      <recent name="E:\Roi Atalla\Documents\Programming Files\Java Files\Personal Projects\OpenGL\src\com\ra4king\opengl\testdata" />
     </key>
     <key name="MoveClassesOrPackagesDialog.RECENTS_KEY">
       <recent name="rosick.jglsdk" />
       <recent name="roFsick.jglsdk" />
       <recent name="rosick.jglsdk.glimg" />
     </key>
+    <key name="MoveFile.RECENT_KEYS">
+      <recent name="E:\Roi Atalla\Documents\Programming Files\Java Files\Personal Projects\OpenGL\src\com\ra4king\opengl\arcsynthesis\gl33\chapter17\example3" />
+      <recent name="E:\Roi Atalla\Documents\Programming Files\Java Files\Personal Projects\OpenGL\src\com\ra4king\opengl\arcsynthesis\gl33\chapter17\example2" />
+      <recent name="E:\Roi Atalla\Documents\Programming Files\Java Files\Personal Projects\OpenGL\src\com\ra4king\opengl\arcsynthesis\gl33\chapter16\example3" />
+      <recent name="E:\Roi Atalla\Documents\Programming Files\Java Files\Personal Projects\OpenGL\src\com\ra4king\opengl\arcsynthesis\gl33\chapter16\example2" />
+      <recent name="E:\Roi Atalla\Documents\Programming Files\Java Files\Personal Projects\OpenGL\src\com\ra4king\opengl\testdata" />
+    </key>
   </component>
-  <component name="RunManager" selected="Application.Example17_2">
-    <configuration default="false" name="Example3_3" type="Application" factoryName="Application" temporary="true">
-      <option name="MAIN_CLASS_NAME" value="com.ra4king.opengl.arcsynthesis.gl32.chapter3.example3.Example3_3" />
-      <option name="VM_PARAMETERS" value="-Djava.library.path=libs/lwjgl/natives" />
-      <option name="PROGRAM_PARAMETERS" value="" />
-      <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
-      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
-      <option name="ALTERNATIVE_JRE_PATH" value="" />
-      <option name="ENABLE_SWING_INSPECTOR" value="false" />
-      <option name="ENV_VARIABLES" />
-      <option name="PASS_PARENT_ENVS" value="true" />
-      <module name="OpenGL" />
-      <envs />
-      <RunnerSettings RunnerId="Run" />
-      <ConfigurationWrapper RunnerId="Run" />
-      <method />
-    </configuration>
+  <component name="RunManager" selected="Application.Example17_3">
     <configuration default="false" name="Example16_3" type="Application" factoryName="Application" temporary="true">
       <option name="MAIN_CLASS_NAME" value="com.ra4king.opengl.arcsynthesis.gl33.chapter16.example3.Example16_3" />
       <option name="VM_PARAMETERS" value="-Djava.library.path=libs/lwjgl/natives" />
       <ConfigurationWrapper RunnerId="Run" />
       <method />
     </configuration>
+    <configuration default="false" name="Example17_3" type="Application" factoryName="Application" temporary="true">
+      <option name="MAIN_CLASS_NAME" value="com.ra4king.opengl.arcsynthesis.gl33.chapter17.example3.Example17_3" />
+      <option name="VM_PARAMETERS" value="-Djava.library.path=libs/lwjgl/natives" />
+      <option name="PROGRAM_PARAMETERS" value="" />
+      <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
+      <option name="ALTERNATIVE_JRE_PATH" value="" />
+      <option name="ENABLE_SWING_INSPECTOR" value="false" />
+      <option name="ENV_VARIABLES" />
+      <option name="PASS_PARENT_ENVS" value="true" />
+      <module name="OpenGL" />
+      <envs />
+      <RunnerSettings RunnerId="Run" />
+      <ConfigurationWrapper RunnerId="Run" />
+      <method />
+    </configuration>
     <configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
       <module name="" />
       <option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m" />
       <option name="PROGRAM_PARAMETERS" />
       <method />
     </configuration>
+    <configuration default="true" type="AndroidTestRunConfigurationType" factoryName="Android Tests">
+      <module name="" />
+      <option name="TESTING_TYPE" value="0" />
+      <option name="INSTRUMENTATION_RUNNER_CLASS" value="" />
+      <option name="METHOD_NAME" value="" />
+      <option name="CLASS_NAME" value="" />
+      <option name="PACKAGE_NAME" value="" />
+      <option name="TARGET_SELECTION_MODE" value="EMULATOR" />
+      <option name="PREFERRED_AVD" value="" />
+      <option name="USE_COMMAND_LINE" value="true" />
+      <option name="COMMAND_LINE" value="" />
+      <option name="WIPE_USER_DATA" value="false" />
+      <option name="DISABLE_BOOT_ANIMATION" value="false" />
+      <option name="NETWORK_SPEED" value="full" />
+      <option name="NETWORK_LATENCY" value="none" />
+      <option name="CLEAR_LOGCAT" value="false" />
+      <method />
+    </configuration>
     <configuration default="true" type="MavenRunConfiguration" factoryName="Maven">
       <MavenSettings>
         <option name="myGeneralSettings" />
       </MavenSettings>
       <method />
     </configuration>
-    <configuration default="true" type="AndroidTestRunConfigurationType" factoryName="Android Tests">
-      <module name="" />
-      <option name="TESTING_TYPE" value="0" />
-      <option name="INSTRUMENTATION_RUNNER_CLASS" value="" />
-      <option name="METHOD_NAME" value="" />
-      <option name="CLASS_NAME" value="" />
-      <option name="PACKAGE_NAME" value="" />
-      <option name="TARGET_SELECTION_MODE" value="EMULATOR" />
-      <option name="PREFERRED_AVD" value="" />
-      <option name="USE_COMMAND_LINE" value="true" />
-      <option name="COMMAND_LINE" value="" />
-      <option name="WIPE_USER_DATA" value="false" />
-      <option name="DISABLE_BOOT_ANIMATION" value="false" />
-      <option name="NETWORK_SPEED" value="full" />
-      <option name="NETWORK_LATENCY" value="none" />
-      <option name="CLEAR_LOGCAT" value="false" />
-      <method />
-    </configuration>
     <configuration default="true" type="Remote" factoryName="Remote">
       <option name="USE_SOCKET_TRANSPORT" value="true" />
       <option name="SERVER_MODE" value="false" />
       <option name="PORT" value="5005" />
       <method />
     </configuration>
-    <configuration default="true" type="Applet" factoryName="Applet">
-      <module name="" />
-      <option name="MAIN_CLASS_NAME" />
-      <option name="HTML_FILE_NAME" />
-      <option name="HTML_USED" value="false" />
-      <option name="WIDTH" value="400" />
-      <option name="HEIGHT" value="300" />
-      <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
-      <option name="VM_PARAMETERS" />
-      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
-      <option name="ALTERNATIVE_JRE_PATH" />
-      <method />
-    </configuration>
     <configuration default="true" type="TestNG" factoryName="TestNG">
       <module name="" />
       <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
       <listeners />
       <method />
     </configuration>
+    <configuration default="true" type="Applet" factoryName="Applet">
+      <module name="" />
+      <option name="MAIN_CLASS_NAME" />
+      <option name="HTML_FILE_NAME" />
+      <option name="HTML_USED" value="false" />
+      <option name="WIDTH" value="400" />
+      <option name="HEIGHT" value="300" />
+      <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
+      <option name="VM_PARAMETERS" />
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
+      <option name="ALTERNATIVE_JRE_PATH" />
+      <method />
+    </configuration>
     <configuration default="true" type="Application" factoryName="Application">
       <option name="MAIN_CLASS_NAME" value="" />
       <option name="VM_PARAMETERS" value="-Djava.library.path=libs/lwjgl/natives" />
       <method />
     </configuration>
     <list size="5">
-      <item index="0" class="java.lang.String" itemvalue="Application.Example3_3" />
-      <item index="1" class="java.lang.String" itemvalue="Application.Example16_3" />
-      <item index="2" class="java.lang.String" itemvalue="Application.Example17_1" />
-      <item index="3" class="java.lang.String" itemvalue="Application.Example14_3" />
-      <item index="4" class="java.lang.String" itemvalue="Application.Example17_2" />
+      <item index="0" class="java.lang.String" itemvalue="Application.Example16_3" />
+      <item index="1" class="java.lang.String" itemvalue="Application.Example17_1" />
+      <item index="2" class="java.lang.String" itemvalue="Application.Example14_3" />
+      <item index="3" class="java.lang.String" itemvalue="Application.Example17_2" />
+      <item index="4" class="java.lang.String" itemvalue="Application.Example17_3" />
     </list>
     <recent_temporary>
       <list size="5">
-        <item index="0" class="java.lang.String" itemvalue="Application.Example17_2" />
-        <item index="1" class="java.lang.String" itemvalue="Application.Example17_1" />
-        <item index="2" class="java.lang.String" itemvalue="Application.Example14_3" />
-        <item index="3" class="java.lang.String" itemvalue="Application.Example16_3" />
-        <item index="4" class="java.lang.String" itemvalue="Application.Example3_3" />
+        <item index="0" class="java.lang.String" itemvalue="Application.Example17_3" />
+        <item index="1" class="java.lang.String" itemvalue="Application.Example17_2" />
+        <item index="2" class="java.lang.String" itemvalue="Application.Example17_1" />
+        <item index="3" class="java.lang.String" itemvalue="Application.Example14_3" />
+        <item index="4" class="java.lang.String" itemvalue="Application.Example16_3" />
       </list>
     </recent_temporary>
     <configuration name="&lt;template&gt;" type="WebApp" default="true" selected="false">
       <created>1369991874662</created>
       <updated>1369991874662</updated>
     </task>
-    <option name="localTasksCounter" value="43" />
+    <task id="LOCAL-00043" summary="Reformat + Example 17.3 skeleton.">
+      <created>1369992074790</created>
+      <updated>1369992074790</updated>
+    </task>
+    <option name="localTasksCounter" value="44" />
     <servers />
   </component>
   <component name="TodoView" selected-index="3">
   </component>
   <component name="ToolWindowManager">
     <frame x="1912" y="-8" width="1936" height="1096" extended-state="6" />
-    <editor active="false" />
+    <editor active="true" />
     <layout>
       <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.23723404" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
       <window_info id="JetGradle" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32977587" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
       <window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
-      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.58528787" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
       <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.31343284" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
       <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.24200426" sideWeight="0.51600856" order="9" side_tool="true" content_ui="tabs" />
       <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.18366013" sideWeight="0.14915694" order="2" side_tool="true" content_ui="tabs" />
       <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.18366013" sideWeight="0.17250325" order="1" side_tool="true" content_ui="tabs" />
       <window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32977587" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
       <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.36819637" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
-      <window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.20170757" sideWeight="0.7579957" order="0" side_tool="true" content_ui="combo" x="2394" y="136" width="397" height="768" />
-      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.24200426" sideWeight="0.48399147" order="2" side_tool="false" content_ui="tabs" />
+      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.20170757" sideWeight="0.880597" order="0" side_tool="true" content_ui="combo" x="2394" y="136" width="397" height="768" />
+      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.11940298" sideWeight="0.48399147" order="2" side_tool="false" content_ui="tabs" />
       <window_info id="Documentation" active="true" anchor="right" auto_hide="false" internal_type="SLIDING" type="FLOATING" visible="true" weight="0.32977587" sideWeight="0.80490404" order="4" side_tool="false" content_ui="combo" x="2005" y="108" width="1736" height="896" />
       <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
       <window_info id="Problems" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32978722" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
       <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
       <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.2497332" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
+      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.58528787" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
       <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
       <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.39978677" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
     </layout>
     <option name="WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN" value="false" />
     <option name="FORCE_NON_EMPTY_COMMENT" value="false" />
     <option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="false" />
-    <option name="LAST_COMMIT_MESSAGE" value="Example 17.2 fully ported, fixed lighting issues." />
+    <option name="LAST_COMMIT_MESSAGE" value="Reformat + Example 17.3 skeleton." />
     <option name="MAKE_NEW_CHANGELIST_ACTIVE" value="false" />
     <option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="true" />
     <option name="CHECK_FILES_UP_TO_DATE_BEFORE_COMMIT" value="false" />
     <option name="UPDATE_FILTER_BY_SCOPE" value="false" />
     <option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
     <option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />
-    <MESSAGE value="Fixed README file." />
     <MESSAGE value="Fixed README file further." />
     <MESSAGE value="Last update to README, I promise." />
     <MESSAGE value="Modified the OTHER README files haha." />
     <MESSAGE value="Removed extraneous file and added Scene.java, no clue why that was ever removed." />
     <MESSAGE value="Example 17.2 almost fully ported, still something wrong with the lighting." />
     <MESSAGE value="Example 17.2 fully ported, fixed lighting issues." />
+    <MESSAGE value="Reformat + Example 17.3 skeleton." />
   </component>
   <component name="XDebuggerManager">
     <breakpoint-manager>
     <option name="FILTER_TARGETS" value="false" />
   </component>
   <component name="editorHistoryManager">
-    <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.scene.xml">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="10" column="28" selection-start="523" selection-end="530" vertical-scroll-proportion="0.16447368">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example1/Example17_1.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="41" column="27" selection-start="1486" selection-end="1486" vertical-scroll-proportion="0.3883495">
-          <folding>
-            <element signature="imports" expanded="true" />
-          </folding>
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter16/example3/Example16_3.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="163" column="61" selection-start="5929" selection-end="5945" vertical-scroll-proportion="0.5339806">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter15/Example15_1.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="50" column="23" selection-start="1506" selection-end="1506" vertical-scroll-proportion="0.4854369">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter16/example2/Example16_2.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="71" column="71" selection-start="2130" selection-end="2130" vertical-scroll-proportion="0.3883495">
-          <folding />
-        </state>
-      </provider>
-    </entry>
     <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter16/example1/Example16_1.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="82" column="81" selection-start="2531" selection-end="2531" vertical-scroll-proportion="0.3883495">
-          <folding />
-        </state>
+        <state line="82" column="81" selection-start="2531" selection-end="2531" vertical-scroll-proportion="0.3883495" />
       </provider>
     </entry>
     <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter16/example3/LightEnv.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="162" column="46" selection-start="5976" selection-end="5976" vertical-scroll-proportion="0.3883495">
-          <folding />
-        </state>
+        <state line="162" column="46" selection-start="5976" selection-end="5976" vertical-scroll-proportion="0.3883495" />
       </provider>
     </entry>
     <entry file="file://$PROJECT_DIR$/src/rosick/jglsdk/glimg/TextureGenerator.java">
     </entry>
     <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.projLight.frag">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="85" column="0" selection-start="2194" selection-end="2194" vertical-scroll-proportion="0.9013158">
-          <folding />
-        </state>
+        <state line="85" column="0" selection-start="2194" selection-end="2194" vertical-scroll-proportion="0.9013158" />
       </provider>
     </entry>
     <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/util/math/Matrix4.java">
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/Example17_3.java">
+    <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.wood4_rotate.dds">
+      <provider selected="true" editor-type-id="images">
+        <state />
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/Example17_2.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="11" column="4" selection-start="253" selection-end="253" vertical-scroll-proportion="0.24087591">
+        <state line="360" column="12" selection-start="11511" selection-end="11511" vertical-scroll-proportion="0.5427632">
+          <folding>
+            <element signature="imports" expanded="true" />
+          </folding>
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.scene.xml">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="22" column="9" selection-start="1040" selection-end="1040" vertical-scroll-proportion="0.3618421">
           <folding />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/Example17_2.java">
+    <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.Colored.frag">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="19" column="0" selection-start="613" selection-end="613" vertical-scroll-proportion="0.4160584">
+        <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
           <folding />
         </state>
       </provider>
     </entry>
+    <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.cubeLight.vert">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="31" column="0" selection-start="764" selection-end="764" vertical-scroll-proportion="0.50986844">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.cubeLight.frag">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="33" column="64" selection-start="752" selection-end="752" vertical-scroll-proportion="0.0">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/Example17_3.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="157" column="4" selection-start="4899" selection-end="4899" vertical-scroll-proportion="0.4275">
+          <folding>
+            <element signature="imports" expanded="true" />
+          </folding>
+        </state>
+      </provider>
+    </entry>
   </component>
   <component name="hg4idea.settings">
     <option name="CHECK_INCOMING_OUTGOING" value="true" />

src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/Example17_2.java

 		}
 		
 		spinBarOrient = nodes.get(3).getOrient();
-		
-		sphereMesh = scene.findMesh("m_sphere");
+
 		unlit = scene.findProgram("p_unlit");
 		unlitModelToCameraMatrixUniform = glGetUniformLocation(unlit.getProgram(), "modelToCameraMatrix");
 		unlitObjectColorUniform = glGetUniformLocation(unlit.getProgram(), "objectColor");
-		
+
+		colored = scene.findProgram("p_colored");
+		coloredModelToCameraMatrixUniform = glGetUniformBlockIndex(colored.getProgram(), "modelToCameraMatrix");
+
+		sphereMesh = scene.findMesh("m_sphere");
 		axesMesh = scene.findMesh("m_axes");
-		colored = scene.findProgram("p_colored");
-		coloredModelToCameraMatrixUniform = glGetUniformLocation(colored.getProgram(), "modelToCameraMatrix");
 	}
 	
 	@Override

src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/Example17_3.java

 package com.ra4king.opengl.arcsynthesis.gl33.chapter17.example3;
 
+import static org.lwjgl.opengl.GL11.*;
+import static org.lwjgl.opengl.GL12.*;
+import static org.lwjgl.opengl.GL13.*;
+import static org.lwjgl.opengl.GL15.*;
+import static org.lwjgl.opengl.GL20.*;
+import static org.lwjgl.opengl.GL30.*;
+import static org.lwjgl.opengl.GL31.*;
+import static org.lwjgl.opengl.GL32.*;
+import static org.lwjgl.opengl.GL33.*;
+
+import java.io.IOException;
+import java.nio.FloatBuffer;
+import java.util.ArrayList;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.input.Keyboard;
+import org.xmlpull.v1.XmlPullParserException;
+
 import com.ra4king.opengl.GLProgram;
+import com.ra4king.opengl.util.Mesh;
+import com.ra4king.opengl.util.MousePoles.MouseButton;
+import com.ra4king.opengl.util.MousePoles.ObjectData;
+import com.ra4king.opengl.util.MousePoles.ObjectPole;
+import com.ra4king.opengl.util.MousePoles.ViewData;
+import com.ra4king.opengl.util.MousePoles.ViewPole;
+import com.ra4king.opengl.util.MousePoles.ViewScale;
+import com.ra4king.opengl.util.ShaderProgram;
+import com.ra4king.opengl.util.Timer;
+import com.ra4king.opengl.util.Timer.Type;
+import com.ra4king.opengl.util.Utils;
+import com.ra4king.opengl.util.math.Matrix4;
+import com.ra4king.opengl.util.math.MatrixStack;
+import com.ra4king.opengl.util.math.Quaternion;
+import com.ra4king.opengl.util.math.Vector3;
+import com.ra4king.opengl.util.math.Vector4;
+import com.ra4king.opengl.util.scene.Scene;
+import com.ra4king.opengl.util.scene.Scene.SceneNode;
+import com.ra4king.opengl.util.scene.binders.UniformIntBinder;
+import com.ra4king.opengl.util.scene.binders.UniformMat4Binder;
+import com.ra4king.opengl.util.scene.binders.UniformVec3Binder;
+
+import rosick.jglsdk.glimg.DdsLoader;
+import rosick.jglsdk.glimg.ImageSet;
+import rosick.jglsdk.glimg.ImageSet.Dimensions;
+import rosick.jglsdk.glimg.TextureGenerator;
 
 /**
  * @author ra4king
 		new Example17_3().run(true);
 	}
 	
+	private Scene scene;
+	private ArrayList<SceneNode> nodes;
+	
+	private Timer timer = new Timer(Type.LOOP, 10);
+	
+	private static final int MAX_NUMBER_OF_LIGHTS = 4;
+	
+	private UniformIntBinder lightNumBinder;
+	private UniformMat4Binder lightProjMatBinder;
+	private UniformVec3Binder camLightPosBinder;
+	
+	private Quaternion spinBarOrient;
+	
+	private ShaderProgram unlit;
+	private int unlitModelToCameraMatrixUniform;
+	private int unlitObjectColorUniform;
+	
+	private ShaderProgram colored;
+	private int coloredModelToCameraMatrixUniform;
+	
+	private Mesh sphereMesh;
+	private Mesh axesMesh;
+	
+	private ViewPole viewPole;
+	private ObjectPole lightPole;
+	
+	private final String[][] texDefs = {
+			{ "IrregularPoint.dds", "Irregular Point Light" },
+			{ "Planetarium.dds", "Planetarium" }
+	};
+	
+	private final int NUM_LIGHT_TEXTURES = texDefs.length;
+	
+	private int[] lightTextures = new int[NUM_LIGHT_TEXTURES];
+	private int currTextureIndex;
+	
+	private int projectionUniformBuffer;
+	private int lightUniformBuffer;
+	
+	private int sampler;
+	
+	private boolean drawCameraPos, showOtherLights = true;
+	
+	private final int projectionBlockIndex = 0;
+	private final int lightBlockIndex = 1;
+	private final int lightProjTexUnit = 3;
+	
 	public Example17_3() {
 		super("Example 17.3 - Cube Point Light", 500, 500, true);
 	}
 	
 	@Override
 	public void init() {
+		glClearColor(0.8f, 0.8f, 0.8f, 1);
+		glClearDepth(1);
 		
+		ViewData initialView = new ViewData(new Vector3(0, 0, 10), new Quaternion(0.16043f, -0.376867f, -0.0664516f, 0.909845f), 25, 0);
+		ViewScale initialViewScale = new ViewScale(5, 70, 2, 0.5f, 2, 0.5f, 90f / 250f);
+		
+		ObjectData initLightData = new ObjectData(new Vector3(0, 0, 10), new Quaternion());
+		
+		viewPole = new ViewPole(initialView, initialViewScale, MouseButton.LEFT_BUTTON);
+		lightPole = new ObjectPole(initLightData, 90f / 250f, MouseButton.RIGHT_BUTTON, viewPole);
+		
+		glEnable(GL_CULL_FACE);
+		glCullFace(GL_BACK);
+		glFrontFace(GL_CW);
+		
+		glEnable(GL_DEPTH_TEST);
+		glDepthMask(true);
+		glDepthFunc(GL_LEQUAL);
+		glDepthRange(0, 1);
+		glEnable(GL_DEPTH_CLAMP);
+		glEnable(GL_FRAMEBUFFER_SRGB);
+		
+		projectionUniformBuffer = glGenBuffers();
+		glBindBuffer(GL_UNIFORM_BUFFER, projectionUniformBuffer);
+		glBufferData(GL_UNIFORM_BUFFER, 16 * 4, GL_STREAM_DRAW);
+		
+		glBindBufferRange(GL_UNIFORM_BUFFER, projectionBlockIndex, projectionUniformBuffer, 0, 16 * 4);
+		
+		glBindBuffer(GL_UNIFORM_BUFFER, 0);
+		
+		createSamplers();
+		loadTextures();
+		
+		try {
+			loadAndSetupScene();
+		} catch(Exception exc) {
+			exc.printStackTrace();
+			destroy();
+		}
+		
+		lightUniformBuffer = glGenBuffers();
+		glBindBuffer(GL_UNIFORM_BUFFER, lightUniformBuffer);
+		glBufferData(GL_UNIFORM_BUFFER, LightBlock.SIZE, GL_STREAM_DRAW);
+		
+		glBindBufferRange(GL_UNIFORM_BUFFER, lightBlockIndex, lightUniformBuffer, 0, LightBlock.SIZE);
+		
+		glBindBuffer(GL_UNIFORM_BUFFER, 0);
+	}
+	
+	private void createSamplers() {
+		sampler = glGenSamplers();
+		glSamplerParameteri(sampler, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+		glSamplerParameteri(sampler, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+		
+		glSamplerParameteri(sampler, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+		glSamplerParameteri(sampler, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+		glSamplerParameteri(sampler, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
+	}
+	
+	private void loadTextures() {
+		try {
+			for(int tex = 0; tex < NUM_LIGHT_TEXTURES; tex++) {
+				lightTextures[tex] = glGenTextures();
+				
+				ImageSet imageSet = DdsLoader.load(getClass().getResourceAsStream("example17.3." + texDefs[tex][0]));
+				
+				glBindTexture(GL_TEXTURE_CUBE_MAP, lightTextures[tex]);
+				glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_BASE_LEVEL, 0);
+				glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAX_LEVEL, 0);
+				
+				Dimensions dims = imageSet.getDimensions();
+				int imageFormat = TextureGenerator.getInternalFormat(imageSet.getFormat(), 0);
+				
+				for(int face = 0; face < 6; face++)
+					glCompressedTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, 0, imageFormat, dims.width, dims.height, 0, imageSet.getImage(0, 0, face).getImageData());
+				
+				glBindTexture(GL_TEXTURE_CUBE_MAP, 0);
+			}
+		} catch(Exception exc) {
+			exc.printStackTrace();
+			destroy();
+		}
+	}
+	
+	private void loadAndSetupScene() throws IOException, XmlPullParserException {
+		scene = new Scene(getClass().getResource("example17.3.scene.xml"), getClass(), "example17.3.");
+		
+		nodes = new ArrayList<>();
+		nodes.add(scene.findNode("cube"));
+		nodes.add(scene.findNode("rightBar"));
+		nodes.add(scene.findNode("leaningBar"));
+		nodes.add(scene.findNode("spinBar"));
+		nodes.add(scene.findNode("diorama"));
+		nodes.add(scene.findNode("floor"));
+		
+		lightNumBinder = new UniformIntBinder();
+		lightProjMatBinder = new UniformMat4Binder();
+		camLightPosBinder = new UniformVec3Binder();
+		
+		for(SceneNode node : nodes) {
+			lightNumBinder.associateWithProgram(node.getProgram(), "numberOfLights");
+			lightProjMatBinder.associateWithProgram(node.getProgram(), "cameraToLightProjMatrix");
+			camLightPosBinder.associateWithProgram(node.getProgram(), "cameraSpaceProjLightPos");
+			
+			node.setStateBinder(lightNumBinder);
+			node.setStateBinder(lightProjMatBinder);
+			node.setStateBinder(camLightPosBinder);
+		}
+		
+		spinBarOrient = nodes.get(3).getOrient();
+		
+		unlit = scene.findProgram("p_unlit");
+		unlitModelToCameraMatrixUniform = glGetUniformLocation(unlit.getProgram(), "modelToCameraMatrix");
+		unlitObjectColorUniform = glGetUniformLocation(unlit.getProgram(), "objectColor");
+		
+		colored = scene.findProgram("p_colored");
+		coloredModelToCameraMatrixUniform = glGetUniformLocation(colored.getProgram(), "modelToCameraMatrix");
+		
+		sphereMesh = scene.findMesh("m_sphere");
+		axesMesh = scene.findMesh("m_axes");
 	}
 	
 	@Override
 	
 	@Override
 	public void update(long deltaTime) {
+		Utils.updateMousePoles(viewPole, lightPole);
 		
+		timer.update(deltaTime);
+		
+		viewPole.charPress(deltaTime);
+		lightPole.charPress(deltaTime);
 	}
 	
 	@Override
 	public void keyPressed(int key, char c) {
+		switch(key) {
+			case Keyboard.KEY_SPACE:
+				lightPole.reset();
+				break;
+			case Keyboard.KEY_T:
+				drawCameraPos = !drawCameraPos;
+				break;
+			case Keyboard.KEY_G:
+				showOtherLights = !showOtherLights;
+				break;
+			case Keyboard.KEY_P:
+				timer.togglePause();
+				break;
+			case Keyboard.KEY_RETURN:
+				try {
+					loadAndSetupScene();
+				} catch(Exception exc) {
+					exc.printStackTrace();
+					destroy();
+				}
+				break;
+		}
 		
+		int possibleIndex = c - '1';
+		if(possibleIndex >= 0 && possibleIndex < NUM_LIGHT_TEXTURES) {
+			currTextureIndex = possibleIndex;
+			System.out.println(texDefs[currTextureIndex][1]);
+		}
 	}
 	
 	@Override
 	public void render() {
+		glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 		
+		Matrix4 cameraMatrix = viewPole.calcMatrix();
+		Matrix4 lightView = lightPole.calcMatrix();
+		
+		MatrixStack modelMatrix = new MatrixStack();
+		modelMatrix.setTop(cameraMatrix);
+		
+		buildLights(cameraMatrix);
+		
+		nodes.get(0).setOrient(Utils.angleAxisDeg(360 * timer.getAlpha(), new Vector3(0, 1, 0)));
+		nodes.get(3).setOrient(spinBarOrient.copy().mult(Utils.angleAxisDeg(360 * timer.getAlpha(), new Vector3(0, 0, 1))));
+		
+		{
+			glBindBuffer(GL_UNIFORM_BUFFER, projectionUniformBuffer);
+			glBufferData(GL_UNIFORM_BUFFER, new Matrix4().clearToPerspectiveDeg(60, getWidth(), getHeight(), 1, 1000).toBuffer(), GL_STREAM_DRAW);
+			glBindBuffer(GL_UNIFORM_BUFFER, 0);
+		}
+		
+		glActiveTexture(GL_TEXTURE0 + lightProjTexUnit);
+		glBindTexture(GL_TEXTURE_CUBE_MAP, lightTextures[currTextureIndex]);
+		glBindSampler(lightProjTexUnit, sampler);
+		
+		{
+			Matrix4 lightProjMatrix = new Matrix4().clearToIdentity();
+			lightProjMatrix.mult(lightView.copy().inverse());
+			lightProjMatrix.mult(cameraMatrix.copy().inverse());
+			
+			lightProjMatBinder.setValue(lightProjMatrix);
+			
+			Vector4 worldLightPos = lightView.getColumn(3);
+			Vector3 lightPos = new Vector3(cameraMatrix.mult(worldLightPos));
+			
+			camLightPosBinder.setValue(lightPos);
+		}
+		
+		glViewport(0, 0, getWidth(), getHeight());
+		scene.render(modelMatrix.getTop());
+		
+		{
+			modelMatrix.pushMatrix();
+			
+			modelMatrix.getTop().mult(lightView);
+			modelMatrix.getTop().scale(15);
+			
+			colored.begin();
+			glUniformMatrix4(coloredModelToCameraMatrixUniform, false, modelMatrix.getTop().toBuffer());
+			axesMesh.render();
+			colored.end();
+			
+			modelMatrix.popMatrix();
+		}
+		
+		if(drawCameraPos) {
+			modelMatrix.pushMatrix();
+			
+			modelMatrix.getTop().clearToIdentity();
+			modelMatrix.getTop().translate(0, 0, -viewPole.getView().radius);
+			modelMatrix.getTop().scale(0.5f);
+			
+			glDisable(GL_DEPTH_TEST);
+			glDepthMask(false);
+			
+			unlit.begin();
+			
+			glUniformMatrix4(unlitModelToCameraMatrixUniform, false, modelMatrix.getTop().toBuffer());
+			glUniform4f(unlitObjectColorUniform, 0.25f, 0.25f, 0.25f, 1);
+			sphereMesh.render("flat");
+			
+			glDepthMask(true);
+			glEnable(GL_DEPTH_TEST);
+			
+			glUniform4f(unlitObjectColorUniform, 1, 1, 1, 1);
+			sphereMesh.render("flat");
+			
+			unlit.end();
+			
+			modelMatrix.popMatrix();
+		}
+	}
+	
+	private void buildLights(Matrix4 cameraMatrix) {
+		LightBlock lightData = new LightBlock(new Vector4(0.2f, 0.2f, 0.2f, 1), 1f / 900f, 2);
+		lightData.lights[0] = new PerLight(cameraMatrix.mult(new Vector4(-0.2f, 0.5f, 0.5f, 0).normalize()), new Vector4(0.2f, 0.2f, 0.2f, 1));
+		lightData.lights[1] = new PerLight(cameraMatrix.mult(new Vector4(5, 6, 0.5f, 1)), new Vector4(3.5f, 6.5f, 3, 1).mult(0.5f));
+		
+		if(showOtherLights)
+			lightNumBinder.setValue(2);
+		else
+			lightNumBinder.setValue(0);
+		
+		glBindBuffer(GL_UNIFORM_BUFFER, lightUniformBuffer);
+		glBufferData(GL_UNIFORM_BUFFER, lightData.toBuffer(), GL_STREAM_DRAW);
+		glBindBuffer(GL_UNIFORM_BUFFER, 0);
+	}
+	
+	private static class PerLight {
+		private Vector4 cameraSpaceLightPos;
+		private Vector4 lightIntensity;
+		
+		public static final int SIZE = 2 * 4 * 4;
+		
+		public PerLight(Vector4 cameraSpaceLightPos, Vector4 lightIntensity) {
+			this.cameraSpaceLightPos = cameraSpaceLightPos;
+			this.lightIntensity = lightIntensity;
+		}
+		
+		private static final FloatBuffer buffer = BufferUtils.createFloatBuffer(SIZE / 4);
+		
+		public FloatBuffer toBuffer() {
+			buffer.clear();
+			buffer.put(cameraSpaceLightPos.toBuffer());
+			buffer.put(lightIntensity.toBuffer());
+			buffer.flip();
+			return buffer;
+		}
+	}
+	
+	private static class LightBlock {
+		private Vector4 ambientIntensity;
+		private float lightAttenuation;
+		private float maxIntensity;
+		private float[] padding = new float[2];
+		
+		private PerLight[] lights = new PerLight[MAX_NUMBER_OF_LIGHTS];
+		
+		public static final int SIZE = 2 * 4 * 4 + MAX_NUMBER_OF_LIGHTS * PerLight.SIZE;
+		
+		public LightBlock(Vector4 ambientIntensity, float lightAttenuation, float maxIntensity) {
+			this.ambientIntensity = ambientIntensity;
+			this.lightAttenuation = lightAttenuation;
+			this.maxIntensity = maxIntensity;
+		}
+		
+		private static final FloatBuffer buffer = BufferUtils.createFloatBuffer(SIZE / 4);
+		
+		public FloatBuffer toBuffer() {
+			buffer.clear();
+			buffer.put(ambientIntensity.toBuffer());
+			buffer.put(lightAttenuation);
+			buffer.put(maxIntensity);
+			buffer.put(padding);
+			
+			for(PerLight light : lights)
+				if(light != null)
+					buffer.put(light.toBuffer());
+			
+			buffer.flip();
+			
+			return buffer;
+		}
 	}
 }

src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.Colored.frag

+#version 330
+
+smooth in vec4 objectColor;
+
+out vec4 outputColor;
+
+void main()
+{
+	outputColor = objectColor;
+}

src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.Colored.vert

+#version 330
+
+layout(std140) uniform;
+
+layout(location = 0) in vec3 position;
+layout(location = 1) in vec4 color;
+
+smooth out vec4 objectColor;
+
+uniform Projection
+{
+	mat4 cameraToClipMatrix;
+};
+
+uniform mat4 modelToCameraMatrix;
+
+void main()
+{
+	gl_Position = cameraToClipMatrix * modelToCameraMatrix * vec4(position, 1.0);
+	objectColor = color;
+}
Add a comment to this file

src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.IrregularPoint.dds

Binary file added.

src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.LongBar.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<?oxygen RNGSchema="../../Documents/meshFormat.rnc" type="compact"?>
+
+<mesh xmlns="http://www.arcsynthesis.com/gltut/mesh">
+	<attribute index="0" type="float" size="3">
+		0.5 0.5 4.5
+		0.5 -0.5 4.5
+		-0.5 -0.5 4.5
+		-0.5 0.5 4.5
+		0.5 0.5 4.5
+		-0.5 0.5 4.5
+		-0.5 0.5 -4.5
+		0.5 0.5 -4.5
+		0.5 0.5 4.5
+		0.5 0.5 -4.5
+		0.5 -0.5 -4.5
+		0.5 -0.5 4.5
+		0.5 0.5 -4.5
+		-0.5 0.5 -4.5
+		-0.5 -0.5 -4.5
+		0.5 -0.5 -4.5
+		0.5 -0.5 4.5
+		0.5 -0.5 -4.5
+		-0.5 -0.5 -4.5
+		-0.5 -0.5 4.5
+		-0.5 0.5 4.5
+		-0.5 -0.5 4.5
+		-0.5 -0.5 -4.5
+		-0.5 0.5 -4.5
+	</attribute>
+	<attribute index="2" type="float" size="3">
+		0 0 1
+		0 0 1
+		0 0 1
+		0 0 1
+		0 1 0
+		0 1 0
+		0 1 0
+		0 1 0
+		1 0 0
+		1 0 0
+		1 0 0
+		1 0 0
+		0 0 -1
+		0 0 -1
+		0 0 -1
+		0 0 -1
+		0 -1 0
+		0 -1 0
+		0 -1 0
+		0 -1 0
+		-1 0 0
+		-1 0 0
+		-1 0 0
+		-1 0 0
+	</attribute>
+	<attribute index="5" type="float" size="2">
+		1 1
+		1 0
+		0 0
+		0 1
+		9 1
+		9 0
+		0 0
+		0 1
+		0 1
+		9 1
+		9 0
+		0 0
+		0 1
+		1 1
+		1 0
+		0 0
+		1 9
+		1 0
+		0 0
+		0 9
+		9 1
+		9 0
+		0 0
+		0 1
+	</attribute>
+	<vao name="lit">
+		<source attrib="0" />
+		<source attrib="2" />
+	</vao>
+	<vao name="lit-tex">
+		<source attrib="0" />
+		<source attrib="2" />
+		<source attrib="5" />
+	</vao>
+	<vao name="tex">
+		<source attrib="0" />
+		<source attrib="5" />
+	</vao>
+	<vao name="flat">
+		<source attrib="0" />
+	</vao>
+	<indices cmd="triangles" type="ushort">
+		0 1 2
+		2 3 0
+		4 5 6
+		6 7 4
+		8 9 10
+		10 11 8
+		12 13 14
+		14 15 12
+		16 17 18
+		18 19 16
+		20 21 22
+		22 23 20
+	</indices>
+</mesh>
Add a comment to this file

src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.Planetarium.dds

Binary file added.

src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.ShortBar.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<?oxygen RNGSchema="../../Documents/meshFormat.rnc" type="compact"?>
+
+<mesh xmlns="http://www.arcsynthesis.com/gltut/mesh">
+	<attribute index="0" type="float" size="3">
+		0.5 0.5 1.5
+		0.5 -0.5 1.5
+		-0.5 -0.5 1.5
+		-0.5 0.5 1.5
+		0.5 0.5 1.5
+		-0.5 0.5 1.5
+		-0.5 0.5 -1.5
+		0.5 0.5 -1.5
+		0.5 0.5 1.5
+		0.5 0.5 -1.5
+		0.5 -0.5 -1.5
+		0.5 -0.5 1.5
+		0.5 0.5 -1.5
+		-0.5 0.5 -1.5
+		-0.5 -0.5 -1.5
+		0.5 -0.5 -1.5
+		0.5 -0.5 1.5
+		0.5 -0.5 -1.5
+		-0.5 -0.5 -1.5
+		-0.5 -0.5 1.5
+		-0.5 0.5 1.5
+		-0.5 -0.5 1.5
+		-0.5 -0.5 -1.5
+		-0.5 0.5 -1.5
+	</attribute>
+	<attribute index="2" type="float" size="3">
+		0 0 1
+		0 0 1
+		0 0 1
+		0 0 1
+		0 1 0
+		0 1 0
+		0 1 0
+		0 1 0
+		1 0 0
+		1 0 0
+		1 0 0
+		1 0 0
+		0 0 -1
+		0 0 -1
+		0 0 -1
+		0 0 -1
+		0 -1 0
+		0 -1 0
+		0 -1 0
+		0 -1 0
+		-1 0 0
+		-1 0 0
+		-1 0 0
+		-1 0 0
+	</attribute>
+	<attribute index="5" type="float" size="2">
+		1 1
+		1 0
+		0 0
+		0 1
+		3 1
+		3 0
+		0 0
+		0 1
+		0 1
+		3 1
+		3 0
+		0 0
+		0 1
+		1 1
+		1 0
+		0 0
+		1 3
+		1 0
+		0 0
+		0 3
+		3 1
+		3 0
+		0 0
+		0 1
+	</attribute>
+	<vao name="lit">
+		<source attrib="0" />
+		<source attrib="2" />
+	</vao>
+	<vao name="lit-tex">
+		<source attrib="0" />
+		<source attrib="2" />
+		<source attrib="5" />
+	</vao>
+	<vao name="tex">
+		<source attrib="0" />
+		<source attrib="5" />
+	</vao>
+	<vao name="flat">
+		<source attrib="0" />
+	</vao>
+	<indices cmd="triangles" type="ushort">
+		0 1 2
+		2 3 0
+		4 5 6
+		6 7 4
+		8 9 10
+		10 11 8
+		12 13 14
+		14 15 12
+		16 17 18
+		18 19 16
+		20 21 22
+		22 23 20
+	</indices>
+</mesh>

src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.UnitAxes.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<?oxygen RNGSchema="../Documents/meshFormat.rnc" type="compact"?>
+
+<mesh xmlns="http://www.arcsynthesis.com/gltut/mesh">
+	<attribute index="0" type="float" size="3">
+		0 0 0
+		0.5 0 0
+		0 0 0
+		0 0.5 0
+		0 0 0
+		0 0 0.5
+	</attribute>
+	<attribute index="1" type="float" size="4">
+		1 0 0 1
+		1 0 0 1
+		0 1 0 1
+		0 1 0 1
+		0 0 1 1
+		0 0 1 1
+	</attribute>
+	<arrays cmd="lines" start="0" count="6" />
+</mesh>

src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.UnitCube.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<?oxygen RNGSchema="../../Documents/meshFormat.rnc" type="compact"?>
+
+<mesh xmlns="http://www.arcsynthesis.com/gltut/mesh">
+	<attribute index="0" type="float" size="3">
+		0.5 0.5 0.5
+		0.5 -0.5 0.5
+		-0.5 -0.5 0.5
+		-0.5 0.5 0.5
+		0.5 0.5 0.5
+		-0.5 0.5 0.5
+		-0.5 0.5 -0.5
+		0.5 0.5 -0.5
+		0.5 0.5 0.5
+		0.5 0.5 -0.5
+		0.5 -0.5 -0.5
+		0.5 -0.5 0.5
+		0.5 0.5 -0.5
+		-0.5 0.5 -0.5
+		-0.5 -0.5 -0.5
+		0.5 -0.5 -0.5
+		0.5 -0.5 0.5
+		0.5 -0.5 -0.5
+		-0.5 -0.5 -0.5
+		-0.5 -0.5 0.5
+		-0.5 0.5 0.5
+		-0.5 -0.5 0.5
+		-0.5 -0.5 -0.5
+		-0.5 0.5 -0.5
+	</attribute>
+	<attribute index="1" type="float" size="4">
+		0.25 1 0.25 1
+		0.25 1 0.25 1
+		0.25 1 0.25 1
+		0.25 1 0.25 1
+		0.5 0.5 1 1
+		0.5 0.5 1 1
+		0.5 0.5 1 1
+		0.5 0.5 1 1
+		1 0.5 0.5 1
+		1 0.5 0.5 1
+		1 0.5 0.5 1
+		1 0.5 0.5 1
+		1 1 0.5 1
+		1 1 0.5 1
+		1 1 0.5 1
+		1 1 0.5 1
+		0.5 1 1 1
+		0.5 1 1 1
+		0.5 1 1 1
+		0.5 1 1 1
+		1 0.5 1 1
+		1 0.5 1 1
+		1 0.5 1 1
+		1 0.5 1 1
+	</attribute>
+	<attribute index="2" type="float" size="3">
+		0 0 1
+		0 0 1
+		0 0 1
+		0 0 1
+		0 1 0
+		0 1 0
+		0 1 0
+		0 1 0
+		1 0 0
+		1 0 0
+		1 0 0
+		1 0 0
+		0 0 -1
+		0 0 -1
+		0 0 -1
+		0 0 -1
+		0 -1 0
+		0 -1 0
+		0 -1 0
+		0 -1 0
+		-1 0 0
+		-1 0 0
+		-1 0 0
+		-1 0 0
+	</attribute>
+	<attribute index="5" type="float" size="2">
+		1 1
+		1 0
+		0 0
+		0 1
+		1 1
+		1 0
+		0 0
+		0 1
+		0 1
+		1 1
+		1 0
+		0 0
+		0 1
+		1 1
+		1 0
+		0 0
+		1 1
+		1 0
+		0 0
+		0 1
+		1 1
+		1 0
+		0 0
+		0 1
+	</attribute>
+	<vao name="lit">
+		<source attrib="0" />
+		<source attrib="2" />
+	</vao>
+	<vao name="lit-color">
+		<source attrib="0" />
+		<source attrib="1" />
+		<source attrib="2" />
+	</vao>
+	<vao name="color">
+		<source attrib="0" />
+		<source attrib="1" />
+	</vao>
+	<vao name="lit-tex">
+		<source attrib="0" />
+		<source attrib="2" />
+		<source attrib="5" />
+	</vao>
+	<vao name="lit-color-tex">
+		<source attrib="0" />
+		<source attrib="1" />
+		<source attrib="2" />
+		<source attrib="5" />
+	</vao>
+	<vao name="color-tex">
+		<source attrib="0" />
+		<source attrib="1" />
+		<source attrib="5" />
+	</vao>
+	<vao name="tex">
+		<source attrib="0" />
+		<source attrib="5" />
+	</vao>
+	<vao name="flat">
+		<source attrib="0" />
+	</vao>
+	<indices cmd="triangles" type="ushort">
+		0 1 2
+		2 3 0
+		4 5 6
+		6 7 4
+		8 9 10
+		10 11 8
+		12 13 14
+		14 15 12
+		16 17 18
+		18 19 16
+		20 21 22
+		22 23 20
+	</indices>
+</mesh>

src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.UnitDiorama.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<?oxygen RNGSchema="../../Documents/meshFormat.rnc" type="compact"?>
+
+<mesh xmlns="http://www.arcsynthesis.com/gltut/mesh">
+	<attribute index="0" type="float" size="3">
+		-0.5 -0.5 0.5
+		-0.5 0.5 0.5
+		-0.5 0.5 -0.5
+		-0.5 -0.5 -0.5
+		-0.5 -0.5 -0.5
+		-0.5 0.5 -0.5
+		0.5 0.5 -0.5
+		0.5 -0.5 -0.5
+		0.5 -0.5 -0.5
+		0.5 0.5 -0.5
+		0.5 0.5 0.5
+		0.5 -0.5 0.5
+		-0.5 -0.5 0.5
+		-0.5 0.5 0.5
+		-0.5 0.5 -0.5
+		-0.5 -0.5 -0.5
+		-0.5 -0.5 -0.5
+		-0.5 0.5 -0.5
+		0.5 0.5 -0.5
+		0.5 -0.5 -0.5
+		0.5 -0.5 -0.5
+		0.5 0.5 -0.5
+		0.5 0.5 0.5
+		0.5 -0.5 0.5
+	</attribute>
+	<attribute index="2" type="float" size="3">
+		1 0 0
+		1 0 0
+		1 0 0
+		1 0 0
+		0 0 1
+		0 0 1
+		0 0 1
+		0 0 1
+		-1 0 0
+		-1 0 0
+		-1 0 0
+		-1 0 0
+		-1 0 0
+		-1 0 0
+		-1 0 0
+		-1 0 0
+		0 0 -1
+		0 0 -1
+		0 0 -1
+		0 0 -1
+		1 0 0
+		1 0 0
+		1 0 0
+		1 0 0
+	</attribute>
+	<attribute index="5" type="float" size="2">
+		0 0
+		0 1
+		1 1
+		1 0
+		0 0
+		0 1
+		1 1
+		1 0
+		0 0
+		0 1
+		1 1
+		1 0
+		0 0
+		0 1
+		1 1
+		1 0
+		0 0
+		0 1
+		1 1
+		1 0
+		0 0
+		0 1
+		1 1
+		1 0
+	</attribute>
+	<vao name="lit">
+		<source attrib="0" />
+		<source attrib="2" />
+	</vao>
+	<vao name="lit-tex">
+		<source attrib="0" />
+		<source attrib="2" />
+		<source attrib="5" />
+	</vao>
+	<vao name="tex">
+		<source attrib="0" />
+		<source attrib="5" />
+	</vao>
+	<vao name="flat">
+		<source attrib="0" />
+	</vao>
+	<indices cmd="triangles" type="ushort">
+		0 1 2
+		2 3 0
+		4 5 6
+		6 7 4
+		8 9 10
+		10 11 8
+		12 15 14
+		14 13 12
+		16 19 18
+		18 17 16
+		20 23 22
+		22 21 20
+	</indices>
+</mesh>

src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.UnitPlane.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<?oxygen RNGSchema="../../Documents/meshFormat.rnc" type="compact"?>
+
+<mesh xmlns="http://www.arcsynthesis.com/gltut/mesh">
+	<attribute index="0" type="float" size="3">
+		0.5 0 -0.5
+		0.5 0 0.5
+		-0.5 0 0.5
+		-0.5 0 -0.5
+		0.5 0 -0.5
+		0.5 0 0.5
+		-0.5 0 0.5
+		-0.5 0 -0.5
+	</attribute>
+	<attribute index="1" type="float" size="4">
+		1 1 1 1
+		1 1 1 1
+		1 1 1 1
+		1 1 1 1
+		1 1 1 1
+		1 1 1 1
+		1 1 1 1
+		1 1 1 1
+	</attribute>
+	<attribute index="2" type="float" size="3">
+		0 1 0
+		0 1 0
+		0 1 0
+		0 1 0
+		0 -1 0
+		0 -1 0
+		0 -1 0
+		0 -1 0
+	</attribute>
+	<attribute index="5" type="float" size="2">
+		1 0
+		1 1
+		0 1
+		0 0
+		1 0
+		1 1
+		0 1
+		0 0
+	</attribute>
+	<vao name="flat">
+		<source attrib="0" />
+	</vao>
+	<vao name="color">
+		<source attrib="0" />
+		<source attrib="1" />
+	</vao>
+	<vao name="lit">
+		<source attrib="0" />
+		<source attrib="2" />
+	</vao>
+	<vao name="lit-color">
+		<source attrib="0" />
+		<source attrib="1" />
+		<source attrib="2" />
+	</vao>
+	<vao name="lit-tex">
+		<source attrib="0" />
+		<source attrib="2" />
+		<source attrib="5" />
+	</vao>
+	<vao name="lit-color-tex">
+		<source attrib="0" />
+		<source attrib="1" />
+		<source attrib="2" />
+		<source attrib="5" />
+	</vao>
+	<indices cmd="triangles" type="ushort">
+		0 1 2
+		2 3 0
+		4 6 5
+		6 4 7
+	</indices>
+</mesh>

src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/example17.3.UnitSphere.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<?oxygen RNGSchema="../../Documents/meshFormat.rnc" type="compact"?>
+
+<mesh xmlns="http://www.arcsynthesis.com/gltut/mesh">
+	<attribute index="0" type="float" size="3">
+		0 0.5 0
+		0.17101007166283 0.46984631039295 0
+		0.15622547417872 0.46984631039295 0.069556062480293
+		0.11442807294522 0.46984631039295 0.12708524986075
+		0.052845018353093 0.46984631039295 0.16264024300704
+		-0.017875419994207 0.46984631039295 0.17007326059719
+		-0.085505035831417 0.46984631039295 0.14809906636301
+		-0.13835005418451 0.46984631039295 0.10051719811689
+		-0.16727309129832 0.46984631039295 0.035554993146286
+		-0.16727309129832 0.46984631039295 -0.035554993146286
+		-0.13835005418451 0.46984631039295 -0.10051719811689
+		-0.085505035831417 0.46984631039295 -0.14809906636301
+		-0.017875419994207 0.46984631039295 -0.17007326059719
+		0.052845018353093 0.46984631039295 -0.16264024300704
+		0.11442807294522 0.46984631039295 -0.12708524986075
+		0.15622547417872 0.46984631039295 -0.069556062480293
+		0.32139380484327 0.38302222155949 0
+		0.29360785052904 0.38302222155949 0.13072263728731
+		0.21505443151476 0.38302222155949 0.23884214300977
+		0.099316147583396 0.38302222155949 0.30566367239308
+		-0.033594800524011 0.38302222155949 0.31963317595235
+		-0.16069690242163 0.38302222155949 0.27833519961321
+		-0.26001305000503 0.38302222155949 0.18891053866504
+		-0.31437057909815 0.38302222155949 0.066821529383317
+		-0.31437057909815 0.38302222155949 -0.066821529383317
+		-0.26001305000503 0.38302222155949 -0.18891053866504
+		-0.16069690242163 0.38302222155949 -0.27833519961321
+		-0.033594800524011 0.38302222155949 -0.31963317595235
+		0.099316147583396 0.38302222155949 -0.30566367239308
+		0.21505443151476 0.38302222155949 -0.23884214300977
+		0.29360785052904 0.38302222155949 -0.13072263728731
+		0.43301270189222 0.25 0
+		0.39557678691519 0.25 0.17612213277682
+		0.28974205177823 0.25 0.32179114877719
+		0.13380828366491 0.25 0.41181955177317
+		-0.045262152304168 0.25 0.43064061300439
+		-0.21650635094611 0.25 0.375
+		-0.35031463461102 0.25 0.25451848022756
+		-0.42355033544314 0.25 0.090028402995978
+		-0.42355033544314 0.25 -0.090028402995978
+		-0.35031463461102 0.25 -0.25451848022756
+		-0.21650635094611 0.25 -0.375
+		-0.045262152304169 0.25 -0.43064061300439
+		0.13380828366491 0.25 -0.41181955177317
+		0.28974205177823 0.25 -0.32179114877719
+		0.39557678691519 0.25 -0.17612213277682
+		0.4924038765061 0.086824088833465 0
+		0.44983332470776 0.086824088833465 0.2002786997676
+		0.32948250445998 0.086824088833465 0.36592739287052
+		0.15216116593649 0.086824088833465 0.46830391540012
+		-0.051470220518218 0.086824088833465 0.48970643654954
+		-0.24620193825305 0.086824088833465 0.42643426597622
+		-0.39836310418954 0.086824088833465 0.28942773678193
+		-0.48164367039647 0.086824088833465 0.1023765225296
+		-0.48164367039647 0.086824088833465 -0.1023765225296
+		-0.39836310418954 0.086824088833465 -0.28942773678193
+		-0.24620193825305 0.086824088833465 -0.42643426597622
+		-0.051470220518219 0.086824088833465 -0.48970643654954
+		0.15216116593649 0.086824088833465 -0.46830391540012
+		0.32948250445998 0.086824088833465 -0.36592739287052
+		0.44983332470776 0.086824088833465 -0.2002786997676
+		0.4924038765061 -0.086824088833465 0
+		0.44983332470776 -0.086824088833465 0.2002786997676
+		0.32948250445998 -0.086824088833465 0.36592739287052
+		0.15216116593649 -0.086824088833465 0.46830391540012
+		-0.051470220518218 -0.086824088833465 0.48970643654954
+		-0.24620193825305 -0.086824088833465 0.42643426597622
+		-0.39836310418954 -0.086824088833465 0.28942773678193
+		-0.48164367039647 -0.086824088833465 0.1023765225296
+		-0.48164367039647 -0.086824088833465 -0.1023765225296