-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
41 lines (40 loc) · 1.32 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<title>webgl-obj-loader dev</title>
<meta charset="UTF-8">
<script id="shader-fs" type="x-shader/x-fragment">
precision mediump float;
varying vec2 vTextureCoord;
varying vec3 vTransformedNormal;
varying vec4 vPosition;
void main(void) {
gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
}
</script>
<script id="shader-vs" type="x-shader/x-vertex">
attribute vec3 aVertexPosition;
attribute vec3 aVertexNormal;
attribute vec2 aTextureCoord;
uniform mat4 uMVMatrix;
uniform mat4 uPMatrix;
uniform mat3 uNMatrix;
varying vec2 vTextureCoord;
varying vec3 vTransformedNormal;
varying vec4 vPosition;
void main(void) {
vPosition = uMVMatrix * vec4(aVertexPosition, 1.0);
gl_Position = uPMatrix * vPosition;
vTextureCoord = aTextureCoord;
vTransformedNormal = uNMatrix * aVertexNormal;
}
</script>
<!-- <script type="text/javascript" src="gl-matrix.js"></script> -->
</head>
<body style='padding:0; margin:0;'>
<div style='margin:0 auto; width:800px;'>
<canvas id="mycanvas" style="border: none;" width="800" height="500"></canvas>
</div>
<script src='app.js'></script>
</body>
</html>