annotate webGL/DrumSimulator.html @ 8:040c922bd7ff draft

keyChar -> keyCode,add sounds
author e105711 <yomitan.ie.u-ryukyu.ac.jp>
date Mon, 14 May 2012 16:19:40 +0900
parents c5455ae6cd70
children 502bc41e0c59
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 <!DOCTYPE html>
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 <html>
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 <head>
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 <title>WebGL test2</title>
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 <script src="src/keybord.js"></script>
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 <script src="src/sound.js"></script>
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 <script src="src/J3DI.js"></script>
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 <script src="src/J3DIMath.js"></script>
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 <script src="src/f4xml.js"></script>
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 <script src="src/const.js"></script>
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 <script src="src/mainfunc.js"></script>
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 <script src="src/jkl-parsexml.js"></script>
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 <script src="src/f4notes.js"></script>
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 <script src="src/Note.js"></script>
5
a730b51d59eb 6th:use stat.js,divide render and update,change a way of updating game.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
17 <script src="src/stats.js"></script>
7
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
18 <script src="src/Obj.js"></script>
2
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 </head>
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 <script id="vshader" type="x-shader/x-vertex">
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 uniform mat4 u_modelViewProjMatrix;
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 uniform mat4 u_normalMatrix;
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 uniform vec3 lightDir;
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
24
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 attribute vec3 vNormal;
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 attribute vec4 vTexCoord;
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 attribute vec4 vPosition;
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
28
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 varying float v_Dot;
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 varying vec2 v_texCoord;
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
31
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 void main()
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 {
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 gl_Position = u_modelViewProjMatrix * vPosition;
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 v_texCoord = vTexCoord.st;
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 vec4 transNormal = u_normalMatrix * vec4(vNormal,1);
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 v_Dot = max(dot(transNormal.xyz, lightDir), 0.0);
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 }
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 </script>
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
40
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 <script id="fshader" type="x-shader/x-fragment">
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 #ifdef GL_ES
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 precision mediump float;
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 #endif
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
45
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 uniform sampler2D sampler2d;
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
47
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 varying float v_Dot;
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 varying vec2 v_texCoord;
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
50
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 void main()
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 {
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 vec4 color = texture2D(sampler2d,v_texCoord);
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 color += vec4(0.1,0.1,0.1,1);
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 // if(color.a == 1.0)color=vec4(1,0,0,1);
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 // else color=vec4(0,1,1,1);
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 gl_FragColor = vec4(color.xyz * v_Dot, color.a);
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 // gl_FragColor = vec4(color.xyz * v_Dot, 0.5);
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 }
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
60 </script>
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
61 <script>
8
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
62 renderStats = new Stats();
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
63 updateStats = new Stats();
5
a730b51d59eb 6th:use stat.js,divide render and update,change a way of updating game.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
64
8
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
65 var MODE = TITLE;
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
66 var AUTO = true;
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
67 notesArray = [];
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
68 objsArray = [];
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
69
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
70 /* these variables are defined at const.js */
7
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
71 // var WIDTH = 1024;
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
72 // var HEIGHT = 640;
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
73 // var FPS = 50;
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
74 // var Interval = 1000/FPS;
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
75
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
76
8
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
77 function main(){
5
a730b51d59eb 6th:use stat.js,divide render and update,change a way of updating game.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
78 document.body.appendChild(renderStats.domElement);
a730b51d59eb 6th:use stat.js,divide render and update,change a way of updating game.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
79 document.body.appendChild(updateStats.domElement);
3
4bcac064db6c 4th commit
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 2
diff changeset
80 c = document.getElementById("example");
2
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
81 c.width = WIDTH;
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
82 c.height = HEIGHT;
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
83 var ctx = init();
8
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
84
5
a730b51d59eb 6th:use stat.js,divide render and update,change a way of updating game.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
85 loop = (function(){
a730b51d59eb 6th:use stat.js,divide render and update,change a way of updating game.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
86 nextGameTick = (new Date).getTime();
a730b51d59eb 6th:use stat.js,divide render and update,change a way of updating game.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
87 return function(){
8
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
88 while((new Date).getTime()>nextGameTick){
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
89 updateStats.update();
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
90 gameUpdate();
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
91 nextGameTick += Interval;
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
92 }
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
93 renderStats.update();
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
94 gameRender(ctx);
5
a730b51d59eb 6th:use stat.js,divide render and update,change a way of updating game.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
95 };
a730b51d59eb 6th:use stat.js,divide render and update,change a way of updating game.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
96 })();
7
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
97 toTitle();
2
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
98 loadSounds();
7
c5455ae6cd70 8th,change a way of update to notes,support ogg and wav sound
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 6
diff changeset
99 loadNotes();
8
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
100 }
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
101
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
102 function gameStart(){
5
a730b51d59eb 6th:use stat.js,divide render and update,change a way of updating game.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
103 setInterval(loop,0);
8
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
104 }
5
a730b51d59eb 6th:use stat.js,divide render and update,change a way of updating game.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
105
8
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
106 function init(){
2
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
107 var gl = initWebGL("example","vshader","fshader",["vNormal","vTexCoord","vPosition"],[0,0,0,1],10000);
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
108 gl.uniform3f(gl.getUniformLocation(gl.program,"lightDir"),0,0,1);
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
109 gl.uniform1i(gl.getUniformLocation(gl.program,"sampler2d"),0);
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
110 gl.enable(gl.TEXTURE_2D);
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
111 parseXml(gl);
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
112
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
113 return gl;
8
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
114 }
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
115
2
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
116
8
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
117 width = -1;
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
118 height = -1;
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
119
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
120 function reshape(ctx)
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
121 {
3
4bcac064db6c 4th commit
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 2
diff changeset
122 width = c.width;
4bcac064db6c 4th commit
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 2
diff changeset
123 height = c.height;
2
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
124
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
125 ctx.viewport(0, 0, width, height);
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
126
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
127 ctx.perspectiveMatrix = new J3DIMatrix4();
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
128 ctx.perspectiveMatrix.ortho(0, -200, 0, -140, 0, 10000);
8
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
129 }
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
130
2
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
131 </script>
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
132 <style type="text/css">
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
133 canvas {
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
134 border: 2px solid black;
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
135 }
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
136 </style>
5
a730b51d59eb 6th:use stat.js,divide render and update,change a way of updating game.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 4
diff changeset
137 <body onload="main()" onkeydown="keybordDown()" onkeypress="keybordPress()" onkeyup="keybordUp()" style='overflow:scroll'>
2
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
138 <canvas id="example">
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
139 There is supposed to be an example drawing here, but it's not important.
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
140 </canvas>
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
141 <div id="console"></div>
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
142 </body>
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
143 </html>