Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
danielweck committed Dec 22, 2017
2 parents 3462fba + aaa8e7d commit 3bb8801
Show file tree
Hide file tree
Showing 301 changed files with 162,907 additions and 411,795 deletions.
Binary file removed epub_content/NeHe-EPUB-1-16.jpg
Binary file not shown.

This file was deleted.

Large diffs are not rendered by default.

This file was deleted.

Large diffs are not rendered by default.

This file was deleted.

Large diffs are not rendered by default.

This file was deleted.

This file was deleted.

This file was deleted.

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions epub_content/NeHe-EPUB-1-16/EPUB/frontmatter/colophon.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<li>A little <a href="https://github.com/rkwright/UpdateModTime">Java program</a> was written (and invoked as a jar)
that updates the OPF, setting the dcterms:modified to the current date and time</li>
<li>A <a href="https://github.com/readium/readium-test-files/blob/master/util/scripts/zip-epub-check.sh">bash script</a>
was written to invoke that jar, zip up all the sources of the Webstorm project and then run them against
was written to invoke that jar, properly package (zip) all the sources of the Webstorm project and then run them against
<a href="https://github.com/IDPF/epubcheck">EPUBCheck</a></li>
</ul>
<p>The actual format of the EPUB is fairly straightforward. There are a few aspects that are interesting. First, each
Expand All @@ -28,14 +28,14 @@
<pre>&lt;itemref&#32;idref="lesson02"&#32;/&gt;
&lt;itemref&#32;idref="lesson02-gl"&#32;properties="rendition:layout-pre-paginated"/&gt;</pre>
<p>It is done this way because the JavaScript code that is the demo has to have a specific size. Normally, in the
browser the JS code fetches the size of the innerWindow, but that doesn't work from inside an EPUB reading system
browser, the JS code fetches the size of the innerWindow, but that doesn't work from inside an EPUB reading system
since it normally wraps the actual page content in a iFrame or other construct. So it works much better to specify
a fixed size page.</p>
<p>The other interesting aspect is the use of PrismJS to colorize the JavaScript code for better readability. This requires
that each block of code to be colorized be wrapped in a &lt;code&gt; element and the language specified as part a
CSS style, e.g. </p>
<pre>&lt;code&#32;class="language-javascript"&gt;</pre>
<p>Finally, all the illegal HTML characters need to be escape (<em>e.g.</em> &amp;lt; <em>etc.</em>). This is a bit of a pain since if the
<p>Finally, all the illegal HTML characters need to be escaped (<em>e.g.</em> &amp;lt; <em>etc.</em>). This is a bit of a pain since if the
actual demo code is modified then the example code in the chapter has to be updated. Fortunately, after the first few
lessons only the JavaScript code is shown in the chapter so it's pretty straightforward.</p>
</div>
Expand Down
21 changes: 11 additions & 10 deletions epub_content/NeHe-EPUB-1-16/EPUB/frontmatter/intro.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -38,33 +38,34 @@

<p>Nonetheless, OpenGL did provide a somewhat independent way of supporting 3D but clearly some standardization was
required. So, in 1992, SGI led the creation of the OpenGL Architecture Review Board (OpenGL ARB), the organization
that would maintain and expand the OpenGL specification in the future. Meanwhile, Microsoft released Direct3D in
1995, which eventually became the main competitor of OpenGL. The two of them battled for years, with DirectX only
available on the relatively ubiquitous Windows platform while OpenGL played a minor role on Windows but was the only
game in town on all other platforms. Eventually, in July 2006 the OpenGL Architecture Review Board voted to transfer
control of the OpenGL API standard to the Khronos Group. Direct3D has remained restricted to the Windows platform
while OpenGL continued to proliferate on all other platforms.</p>
that would maintain and expand the OpenGL specification in the future. </p>
<p>Meanwhile, Microsoft released Direct3D in
1995, which eventually became the main competitor of OpenGL. The two of them battled for years, with DirectX only
available on the relatively ubiquitous Windows platform while OpenGL played a minor role on Windows but was the only
game in town on all other platforms. Eventually, in July 2006 the OpenGL Architecture Review Board voted to transfer
control of the OpenGL API standard to the Khronos Group. Direct3D has remained restricted to the Windows platform
while OpenGL continued to proliferate on all other platforms.</p>

<p>The early efforts were based on many different hardware platforms, many with dedicated 3D hardware, or specialized
CPUs that were used to render the 3D software. However, in the late 90s came the advent of the GPU, from NVidia and
CPUs that were used to render the 3D software. However, in the late 90s came the advent of the GPU from NVidia and
others. These chips revolutionized 3D rendering. They didn’t consist of one or more central processors. Instead, they
were highly parallel, comprising thousands (and nowadays hundreds of thousands) of processor units that can work in
were highly parallellized, comprising thousands of processor units that can work in
parallel. This immense change led to a major evolution of OpenGL.</p>

<p>The original architecture of OpenGL was based on relatively high level constructs that were intended to hide the
underlying hardware. So one could specify shapes, colors, etc. in a way that made sense to a human. On the other
hand, the GPUs were so different that the old way of specifying shapes didn’t map very well to the GPUs. So instead,
a new intermediate language arose: the shader language. The original OpenGL was then superseded by the new OpenGL
based on shader languages, OpenGL-ES (extended shader language). This was great in one way, but writing programs in
shader language was not for the faint-hearted and because all execution occurred on the GPUs, it was very hard to
shader language was not for the faint-hearted and, because all execution occurred on the GPUs, it was very hard to
debug.</p>

<p>While all this was going on, the Web continued to explode, with HTML5, CSS3 and SVG. And because the cost of GPUs was
falling (following Moore’s law) the power of 3D was starting to reach even low-powered, relatively cheap phones and
tablets. There was obviously a need for some easier way to use all this power and put it into the hands of <em><strong>web</strong></em> developers who might know JavaScript but had no desire to learn how to program in <em><strong>shader</strong></em> language. Several efforts
have been made to create a JavaScript library that would allow Web developers to access the 3D capabilites. One of
the most complete and popular at present is <a href="http://threejs.org/">three.js</a>. Three.js was developed by Ricardo Cabello ( “Mr.Doob”), based
on some work originally done for Google. The work is open-source, hosted on github. It is listed as “alpha” but
on some work originally done for Google. The work is now open-source, hosted on github. It is listed as “alpha” but
there is no official organization or timeline known to the public.</p>

<p>While all this was going on, there was a lot of development of applications based on OpenGL and lots of experimentation
Expand Down
10 changes: 5 additions & 5 deletions epub_content/NeHe-EPUB-1-16/EPUB/frontmatter/preface.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@
lessons using the well known OpenGL lessons known as <a href="http://nehe.gamedev.net/">NeHe</a>. He posted these
to his <a href="http://www.johannes-raida.de/index.htm">website.</a> Ric then joined in and began porting the rest of
the lessons to three.js and WebGL.</p>
<p>To date, about half of the 48 lessons have been ported. This book covers the first 15 lessons. We have not ported
all of them for various reasons. The first is just an explanation of how to set up OpenGL. We do cover &quot;setting
<p>All 48 lessons have now been ported. This book covers the first 16 lessons. Subsequent volumes cover lessons 17-32 and 33-48.Not all of them have been ported for various reasons. The first lesson, for example, is just an explanation of how to set up OpenGL. We do cover &quot;setting
up&quot; WebGL and three.js, but since it is pretty trivial (all the major browsers now support WebGL by default) the
first chapter is pretty short. Some of the other lessons cover subjects (e.g. using bitmap fonts) which are unneeded
or &quot;just work&quot; in three.js so don't warrantspend time covering.</p>
or &quot;just work&quot; in three.js so don't warrant spending time covering.</p>
<p>Ric is the Director of Engineering for the <a href="http://readium.org/">Readium</a> project, which is an open-source
foundation dedicated to providing web apps and a SDK for rendering <a href="http://idpf.org/epub/301">EPUB</a>, the
standard format for eBooks. As a demonstration of the capabilities of EPUB and Readium, Ric took the lessons and
created this EPUB. The details of how this book was created are covered in the colophon at the end of the book.</p>
created these EPUBs. The details of how this book was created are covered in the <a href="colophon.xhtml" title="Colophon" target="_self">colophon</a> at the end of the book.</p>
<p>If you have any feedback, suggestions or bug reports about this book, you are strongly encouraged to contact
<a href="mailto:rkwright@readium.org">Ric</a> directly.</p>
<p>Version 1.04</p>
<p><em>Johnsburg, Illinois<br/>
November 2017</em></p>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ THREE.OrbitControls = function ( object, domElement ) {
} else {

// camera neither orthographic or perspective
console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.' );
console.warn( 'WARNING: OrbitControls.three-js encountered an unknown camera type - pan disabled.' );

}

Expand Down
4 changes: 2 additions & 2 deletions epub_content/NeHe-EPUB-1-16/EPUB/gfx/gfx-scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ GFX.Scene = function ( parameters ) {
};

// the scene's parameters from the values JSON object
// lifted from MrDoob's implementation in three.js
// lifted from MrDoob's implementation in three.three-js
GFX.setParameters = function( object, values ) {

if ( values === undefined ) return;
Expand Down Expand Up @@ -167,7 +167,7 @@ GFX.Scene.prototype = {
this.canvasHeight = container.clientHeight;
}

// allocate the THREE.js renderer
// allocate the THREE.three-js renderer
this.renderer = new THREE.WebGLRenderer({antialias:true, alpha: this.alphaBuffer});
this.renderer.autoClear = this.autoClear;

Expand Down
2 changes: 1 addition & 1 deletion epub_content/NeHe-EPUB-1-16/EPUB/lesson02/lesson02.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>NeHe-EPUB-02</title>
<link type="text/css" href="../css/NeHe-EPUB.css" rel="stylesheet"/>
<link type="text/css" href="../css/prism.css" rel="stylesheet"/>
<script src="../js/prism.js"></script>
<script src="../three-js/prism.js"></script>
<meta charset="utf-8"/>
</head>
<body>
Expand Down
14 changes: 7 additions & 7 deletions epub_content/NeHe-EPUB-1-16/EPUB/lesson02/lesson02webgl.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@
}
</style>
<!-- Include two libraries
1. Three.js (core library)
2. Detector.js (checks the browsers WebGL capabilities) -->
<script src="../js/three.js"></script>
<script src="../js/Detector.js"></script>
1. Three.three-js (core library)
2. Detector.three-js (checks the browsers WebGL capabilities) -->
<script src="../three-js/three.js"></script>
<script src="../three-js/Detector.js"></script>
</head>
<body id="page">
<!-- This is the DIV element which will contain the WebGL canvas. To be identifiable later on,
the id 'WebGLCanvas' is applied to it. -->
<div id="WebGLCanvas">

<!-- This JavaScript block encloses the Three.js commands -->
<!-- This JavaScript block encloses the Three.three-js commands -->
<script>
// Global objects
var scene;
Expand Down Expand Up @@ -100,7 +100,7 @@
scene = new THREE.Scene();

// Now that we have a scene, we want to look into it. Therefore we need a camera.
// Three.js offers three camera types:
// Three.three-js offers three camera types:
// - PerspectiveCamera (perspective projection)
// - OrthographicCamera (parallel projection)
// - CombinedCamera (allows to switch between perspective / parallel projection
Expand All @@ -111,7 +111,7 @@
// ... aspect ratio (usually set to the quotient of canvas width to canvas height)
// ... near and
// ... far.
// Near and far define the clipping planes of the view frustum. Three.js provides an
// Near and far define the clipping planes of the view frustum. Three.three-js provides an
// example (http://mrdoob.github.com/three.js/examples/
// -> canvas_camera_orthographic2.html), which allows to play around with these
// parameters.
Expand Down
2 changes: 1 addition & 1 deletion epub_content/NeHe-EPUB-1-16/EPUB/lesson03/lesson03.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>NeHe-EPUB-03</title>
<link type="text/css" href="../css/NeHe-EPUB.css" rel="stylesheet"/>
<link type="text/css" href="../css/prism.css" rel="stylesheet"/>
<script src="../js/prism.js"></script>
<script src="../three-js/prism.js"></script>
<meta charset="utf-8"/>
</head>
<body>
Expand Down
14 changes: 7 additions & 7 deletions epub_content/NeHe-EPUB-1-16/EPUB/lesson03/lesson03webgl.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
}
</style>
<!-- Include two libraries
1. Three.js (core library)
2. Detector.js (checks the browsers WebGL capabilities) -->
<script src="../js/three.js"></script>
<script src="../js/Detector.js"></script>
1. Three.three-js (core library)
2. Detector.three-js (checks the browsers WebGL capabilities) -->
<script src="../three-js/three.js"></script>
<script src="../three-js/Detector.js"></script>
</head>
<body>
<!-- This is the DIV element which will contain the WebGL canvas. To be identifiable later on,
the id 'WebGLCanvas' is applied to it. -->
<div id="WebGLCanvas">

<!-- This JavaScript block encloses the Three.js commands -->
<!-- This JavaScript block encloses the Three.three-js commands -->
<script>
// Global scene object
var scene;
Expand Down Expand Up @@ -80,7 +80,7 @@
scene = new THREE.Scene();

// Now that we have a scene, we want to look into it. Therefore we need a camera.
// Three.js offers three camera types:
// Three.three-js offers three camera types:
// - PerspectiveCamera (perspective projection)
// - OrthographicCamera (parallel projection)
// - CombinedCamera (allows to switch between perspective / parallel projection
Expand All @@ -91,7 +91,7 @@
// ... aspect ratio (usually set to the quotient of canvas width to canvas height)
// ... near and
// ... far.
// Near and far define the cliping planes of the view frustum. Three.js provides an
// Near and far define the cliping planes of the view frustum. Three.three-js provides an
// example (http://mrdoob.github.com/three.js/examples/
// -> canvas_camera_orthographic2.html), which allows to play around with these
// parameters.
Expand Down
2 changes: 1 addition & 1 deletion epub_content/NeHe-EPUB-1-16/EPUB/lesson04/lesson04.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>NeHe-EPUB-04</title>
<link type="text/css" href="../css/NeHe-EPUB.css" rel="stylesheet"/>
<link type="text/css" href="../css/prism.css" rel="stylesheet"/>
<script src="../js/prism.js"></script>
<script src="../three-js/prism.js"></script>
<meta charset="utf-8"/>
</head>
<body>
Expand Down
16 changes: 8 additions & 8 deletions epub_content/NeHe-EPUB-1-16/EPUB/lesson04/lesson04webgl.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
}
</style>
<!-- Include two libraries
1. Three.js (core library)
2. Detector.js (checks the browsers WebGL capabilities) -->
<script src="../js/three.js"></script>
<script src="../js/Detector.js"></script>
1. Three.three-js (core library)
2. Detector.three-js (checks the browsers WebGL capabilities) -->
<script src="../three-js/three.js"></script>
<script src="../three-js/Detector.js"></script>
</head>
<body>
<!-- This is the DIV element which will contain the WebGL canvas. To be identifiable later on,
the id 'WebGLCanvas' is applied to it. -->
<div id="WebGLCanvas">

<!-- This JavaScript block encloses the Three.js commands -->
<!-- This JavaScript block encloses the Three.three-js commands -->
<script>
// Global scene object
var scene;
Expand Down Expand Up @@ -89,7 +89,7 @@
scene = new THREE.Scene();

// Now that we have a scene, we want to look into it. Therefore we need a camera.
// Three.js offers three camera types:
// Three.three-js offers three camera types:
// - PerspectiveCamera (perspective projection)
// - OrthographicCamera (parallel projection)
// - CombinedCamera (allows to switch between perspective / parallel projection
Expand All @@ -100,7 +100,7 @@
// ... aspect ratio (usually set to the quotient of canvas width to canvas height)
// ... near and
// ... far.
// Near and far define the clipping planes of the view frustum. Three.js provides an
// Near and far define the clipping planes of the view frustum. Three.three-js provides an
// example (http://mrdoob.github.com/three.js/examples/
// -> canvas_camera_orthographic2.html), which allows to play around with these
// parameters.
Expand All @@ -125,7 +125,7 @@
// To color the surface, a material has to be created. If all vertices shall have
// different colors, we need to set the vertex colors of each face. The colors in
// between will be interpolated as color gradients.
// Unfortunately, the canvas renderer doesn't support vertex yolors (yet [Three.js,
// Unfortunately, the canvas renderer doesn't support vertex yolors (yet [Three.three-js,
// release 50]). Either you accept a white face color, or set another face color.

triangleGeometry.faces[0].vertexColors[0] = new THREE.Color(0xFF0000);
Expand Down
2 changes: 1 addition & 1 deletion epub_content/NeHe-EPUB-1-16/EPUB/lesson05/lesson05.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>NeHe-EPUB-04</title>
<link type="text/css" href="../css/NeHe-EPUB.css" rel="stylesheet"/>
<link type="text/css" href="../css/prism.css" rel="stylesheet"/>
<script src="../js/prism.js"></script>
<script src="../three-js/prism.js"></script>
<meta charset="utf-8"/>
</head>
<body>
Expand Down
14 changes: 7 additions & 7 deletions epub_content/NeHe-EPUB-1-16/EPUB/lesson05/lesson05webgl.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
}
</style>
<!-- Include two libraries
1. Three.js (core library)
2. Detector.js (checks the browsers WebGL capabilities) -->
<script src="../js/three.js"></script>
<script src="../js/Detector.js"></script>
1. Three.three-js (core library)
2. Detector.three-js (checks the browsers WebGL capabilities) -->
<script src="../three-js/three.js"></script>
<script src="../three-js/Detector.js"></script>
</head>
<body>
<!-- This is the DIV element which will contain the WebGL canvas. To be identifiable later on,
the id 'WebGLCanvas' is applied to it. -->
<div id="WebGLCanvas">

<!-- This JavaScript block encloses the Three.js commands -->
<!-- This JavaScript block encloses the Three.three-js commands -->
<script type="text/javascript"> //<![CDATA[
// Global scene object
var scene;
Expand Down Expand Up @@ -85,7 +85,7 @@
scene = new THREE.Scene();

// Now that we have a scene, we want to look into it. Therefore we need a camera.
// Three.js offers three camera types:
// Three.three-js offers three camera types:
// - PerspectiveCamera (perspective projection)
// - OrthographicCamera (parallel projection)
// - CombinedCamera (allows to switch between perspective / parallel projection
Expand All @@ -96,7 +96,7 @@
// ... aspect ratio (usually set to the quotient of canvas width to canvas height)
// ... near and
// ... far.
// Near and far define the cliping planes of the view frustum. Three.js provides an
// Near and far define the cliping planes of the view frustum. Three.three-js provides an
// example (http://mrdoob.github.com/three.js/examples/
// -> canvas_camera_orthographic2.html), which allows to play around with these
// parameters.
Expand Down
2 changes: 1 addition & 1 deletion epub_content/NeHe-EPUB-1-16/EPUB/lesson06/lesson06.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>NeHe-EPUB-06</title>
<link type="text/css" href="../css/NeHe-EPUB.css" rel="stylesheet"/>
<link type="text/css" href="../css/prism.css" rel="stylesheet"/>
<script src="../js/prism.js"></script>
<script src="../three-js/prism.js"></script>
<meta charset="utf-8"/>
</head>
<body>
Expand Down
Loading

0 comments on commit 3bb8801

Please sign in to comment.