-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.html
94 lines (64 loc) · 2.25 KB
/
bootstrap.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Extrude Dynamic Polygon</title>
<meta name="generator" content="TextMate http://macromates.com/"/>
<meta name="author" content="Alex Bustin"/>
<script id="vBasic" type="x-shader/x-vertex">
attribute vec3 aVertexPosition;
attribute vec2 aTextureCoord;
uniform mat4 uMVMatrix;
uniform mat4 uPMatrix;
uniform sampler2D texture;
varying vec2 tc;
void main(void) {
mat4 PMVMatrix = uPMatrix * uMVMatrix;
vec4 pos = vec4(aVertexPosition, 1.0);
tc = vec2(aTextureCoord.s, aTextureCoord.t);
gl_Position = PMVMatrix*pos;
}
</script>
<script id="fAlphaTexture" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D texture;
varying vec2 tc;
void main(void) {
gl_FragColor = texture2D(texture, tc);
}
</script>
<script type="text/javascript" charset="utf-8" src="CanvasMatrix.js"></script>
<!--<script type="text/javascript" charset="utf-8" src="webgl-debug.js"></script>-->
<script type="text/javascript" charset="utf-8" src="Framerate.js"></script>
<script type="text/javascript" charset="utf-8" src="j5.js"></script>
<script type="text/javascript" charset="utf-8" src="j5-polygon.js"></script>
<script type="text/javascript" charset="utf-8">
function init() {
var canvas2d = document.getElementById("canvas2dcanvas");
var c2d = canvas2d.getContext("2d");
j5.attachCanvas(document.getElementById("webglcanvas"));
var drawCube = j5.cube().draw;
var texShader = j5.shader();
var container = j5.offset({});
//j5.texture("leaf.png", function(txt) {
// texShader.$texture = txt;
//});
j5.requestAnimationFrame(function onFrame() {
drawCube(texShader, container);
j5.requestAnimationFrame(onFrame);
});
}
window.addEventListener("load", init, false);
</script>
<!-- Date: 2011-06-18 -->
</head>
<body >
<div class="controls"></div>
<div style="width:1054px;">
<canvas style="background-color:black" id="webglcanvas" width="512" height="512"><!----></canvas>
</div>
</body>
</html>