-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpointsAndLines.html
More file actions
53 lines (40 loc) · 1.34 KB
/
pointsAndLines.html
File metadata and controls
53 lines (40 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<html>
<head>
<title>Real-Time 3D Graphics with WebGL2</title>
<link rel="shortcut icon" type="image/png" href="/common/images/favicon.png" />
<!-- libraries -->
<link rel="stylesheet" href="common/lib/normalize.css">
<!-- modules -->
<script type="text/javascript" src="common/js/utils.js"></script>
<!-- vertex Shader -->
<script id="vertex-shader" type="x-shader/x-vertex">
#version 300 es
precision mediump float;
// Supplied vertex position attribute
in vec3 aVertexPosition;
void main(void) {
// Simply set the position in clipspace coordinates
gl_Position = vec4(aVertexPosition, 1.0);
gl_PointSize = 3.0;
}
</script>
<!-- fragment Shader -->
<script id="fragment-shader" type="x-shader/x-fragment">
#version 300 es
precision mediump float;
// Color that is the result of this shader
out vec4 fragColor;
void main(void) {
// Set the result as red
fragColor = vec4(1.0, 0.0, 0.0, 1.0);
}
</script>
<!-- This is the bulk of the actual WebGL stuff -->
<script type="text/javascript" src="pointAndLineFunctions.js"></script>
</head>
<body>
<canvas id="webgl-canvas">
Your browser does not support the HTML5 canvas element.
</canvas>
</body>
</html>