Showing
12 changed files
with
16 additions
and
14 deletions
| @@ -32,7 +32,7 @@ | @@ -32,7 +32,7 @@ | ||
| 32 | top: 0px; | 32 | top: 0px; |
| 33 | width: 1920px; | 33 | width: 1920px; |
| 34 | height: 1200px; | 34 | height: 1200px; |
| 35 | - background-image: url(./background1.jpg); | 35 | + background-image: url(../images/background1.jpg); |
| 36 | padding: 0px; | 36 | padding: 0px; |
| 37 | margin: 0px; | 37 | margin: 0px; |
| 38 | z-index: -1; | 38 | z-index: -1; |
| 1 | <html> | 1 | <html> |
| 2 | <head> | 2 | <head> |
| 3 | <title>Colored animated cube.</title> | 3 | <title>Colored animated cube.</title> |
| 4 | - <link rel="stylesheet" href="main.css"> | ||
| 5 | - <script src="gl-matrix-min.js" type="text/javascript"></script> | ||
| 6 | - <script src="cube.js" type="text/javascript"></script> | 4 | + <link rel="stylesheet" href="css/main.css"> |
| 5 | + <script type="text/javascript" src="js/gl-matrix-min.js"></script> | ||
| 6 | + <script type="text/javascript" src="js/cube.js"></script> | ||
| 7 | 7 | ||
| 8 | <script id="cube-vertex-shader" type="x-shader/x-vertex"> | 8 | <script id="cube-vertex-shader" type="x-shader/x-vertex"> |
| 9 | attribute vec3 vertexPos; | 9 | attribute vec3 vertexPos; |
| @@ -38,8 +38,7 @@ function initTexture(gl) { | @@ -38,8 +38,7 @@ function initTexture(gl) { | ||
| 38 | webGLTexture.image.onload = function () { | 38 | webGLTexture.image.onload = function () { |
| 39 | handleTextureLoaded(gl, webGLTexture) | 39 | handleTextureLoaded(gl, webGLTexture) |
| 40 | } | 40 | } |
| 41 | - //webGLTexture.image.src = "P3D/images/webgl-logo-256.jpg"; | ||
| 42 | - webGLTexture.image.src = "gravatar-256.jpg"; | 41 | + webGLTexture.image.src = "images/gravatar-256.jpg"; |
| 43 | } | 42 | } |
| 44 | 43 | ||
| 45 | function initWebGL(canvas) { | 44 | function initWebGL(canvas) { |
| 1 | <html> | 1 | <html> |
| 2 | <head> | 2 | <head> |
| 3 | <title>First very simple WebGL example...</title> | 3 | <title>First very simple WebGL example...</title> |
| 4 | - <link rel="stylesheet" href="main.css"> | ||
| 5 | - <script src="gl-matrix-min.js" type="text/javascript"></script> | ||
| 6 | - <script src="square.js" type="text/javascript"></script> | 4 | + <link rel="stylesheet" href="css/main.css"> |
| 5 | + <script type="text/javascript" src="js/gl-matrix-min.js"></script> | ||
| 6 | + <script type="text/javascript" src="js/square.js"></script> | ||
| 7 | 7 | ||
| 8 | <script id="square-vertex-shader" type="x-shader/x-vertex"> | 8 | <script id="square-vertex-shader" type="x-shader/x-vertex"> |
| 9 | attribute vec3 vertexPos; | 9 | attribute vec3 vertexPos; |
| 1 | <html> | 1 | <html> |
| 2 | <head> | 2 | <head> |
| 3 | <title>My first animated and textured WebGL content.</title> | 3 | <title>My first animated and textured WebGL content.</title> |
| 4 | - <link rel="stylesheet" href="main.css"> | ||
| 5 | - <script src="gl-matrix-min.js" type="text/javascript"></script> | ||
| 6 | - <script src="texture.js" type="text/javascript"></script> | 4 | + <link rel="stylesheet" href="css/main.css"> |
| 5 | + <script type="text/javascript" src="js/gl-matrix-min.js"></script> | ||
| 6 | + <script type="text/javascript" src="js/texture.js"></script> | ||
| 7 | 7 | ||
| 8 | <script id="texture-vertex-shader" type="x-shader/x-vertex"> | 8 | <script id="texture-vertex-shader" type="x-shader/x-vertex"> |
| 9 | attribute vec3 vertexPos; | 9 | attribute vec3 vertexPos; |
| @@ -13,7 +13,8 @@ | @@ -13,7 +13,8 @@ | ||
| 13 | varying vec2 vTexCoord; | 13 | varying vec2 vTexCoord; |
| 14 | void main(void) { | 14 | void main(void) { |
| 15 | // Return the transformed and projected vertex value | 15 | // Return the transformed and projected vertex value |
| 16 | - gl_Position = projectionMatrix * modelViewMatrix * vec4(vertexPos, 1.0); | 16 | + gl_Position = |
| 17 | + projectionMatrix * modelViewMatrix * vec4(vertexPos, 1.0); | ||
| 17 | // Output the texture coordinate in vTexCoord | 18 | // Output the texture coordinate in vTexCoord |
| 18 | vTexCoord = texCoord; | 19 | vTexCoord = texCoord; |
| 19 | } | 20 | } |
Please
register
or
login
to post a comment