├── 1
├── HelloPoint1.html
└── HelloPoint1.js
├── 2
├── HelloPoint1.html
└── HelloPoint1.js
├── 3
├── HelloTriangle.html
└── HelloTriangle.js
├── 4
├── ColoredTriangle.html
└── ColoredTriangle.js
├── 6
├── Triangle_MVPMatrix.html
└── Triangle_MVPMatrix.js
├── 7
├── Cuboid.html
└── Cuboid.js
├── 8
├── Cuboid_UI.html
└── Cuboid_UI.js
├── 9
├── TerrainViewer.html
└── TerrainViewer.js
├── 10
├── TerrainViewer.html
└── TerrainViewer.js
├── 11
├── TerrainViewer.html
├── TerrainViewer.js
└── tex.jpg
├── 12
├── TerrainViewer.html
└── TerrainViewer.js
├── 13
├── TerrainViewer.html
└── TerrainViewer.js
├── 14
├── TerrainViewer.html
└── TerrainViewer.js
├── 15
├── TerrainViewer.html
└── TerrainViewer.js
├── 1.gif
├── 2.gif
├── Data
├── DEM.dem
├── DEM.prj
├── DEM.tfw
├── DEM.tif
├── DOM.prj
├── DOM.tfw
├── DOM.tif
├── DOM.tif.ovr
├── new.bin
├── new.gltf
├── sky_cloud.jpg
└── tex.jpg
├── README.md
└── lib
├── cuon-matrix.js
├── cuon-utils.js
├── webgl-debug.js
└── webgl-utils.js
/1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fafa1899/WebGLTutorial/4431734a5550fd5a33b19d91fedda478f7454804/1.gif
--------------------------------------------------------------------------------
/1/HelloPoint1.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Draw a point (1)
6 |
7 |
8 |
9 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/1/HelloPoint1.js:
--------------------------------------------------------------------------------
1 | // 顶点着色器程序
2 | var VSHADER_SOURCE =
3 | 'void main() {\n' +
4 | ' gl_Position = vec4(0.0, 0.0, 0.0, 1.0);\n' + // Set the vertex coordinates of the point
5 | ' gl_PointSize = 10.0;\n' + // Set the point size
6 | '}\n';
7 |
8 | // 片元着色器程序
9 | var FSHADER_SOURCE =
10 | 'void main() {\n' +
11 | ' gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\n' + // Set the point color
12 | '}\n';
13 |
14 | function main() {
15 | // 获取