annotate webGL/DrumSimulator.html @ 18:fafb468bd914 draft

July 5th
author e105711 <yomitan.ie.u-ryukyu.ac.jp>
date Thu, 05 Jul 2012 15:18:19 +0900
parents 1e8fa3c370ab
children df7f7eef72ef
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>
12
c358bb5a031b can load localfile
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
19 <script src="src/jquery-1.7.2.min.js"></script>
13
74dc1d5f2e47 can select music
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
20 <script src="src/Cursor.js"></script>
14
1eebc1f7874d add script for count a number of music files
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
21 <script src="src/loadMusicFiles.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
22 </head>
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 <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
24 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
25 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
26 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
27
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 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
29 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
30 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
31
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 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
33 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
34
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 void main()
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 {
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 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
38 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
39 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
40 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
41 }
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 </script>
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
43
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 <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
45 #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
46 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
47 #endif
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
48
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 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
50
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 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
52 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
53
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 void main()
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 {
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 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
57 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
58 // 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
59 // 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
60 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
61 // 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
62 }
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
63 </script>
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
64 <script>
8
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
65 renderStats = new Stats();
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
66 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
67
8
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
68 var MODE = TITLE;
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
69 var AUTO = true;
11
502bc41e0c59 FPS:50->60 notesArray:[](all notes in)->[lane][note](prepared eight array for notes.)
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
70 var notesArray = [[],[],[],[],[],[],[],[]];
502bc41e0c59 FPS:50->60 notesArray:[](all notes in)->[lane][note](prepared eight array for notes.)
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
71 var objsArray = [];
13
74dc1d5f2e47 can select music
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
72 var musicsArray = [];
74dc1d5f2e47 can select music
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
73 var cursor = new Cursor();
74dc1d5f2e47 can select music
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
74
8
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
75 /* these variables are defined at const.js */
15
80789d11de5c add function for text draw
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 14
diff changeset
76 // var WIDTH,HEIGHT,FPS,Interval
80789d11de5c add function for text draw
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 14
diff changeset
77
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
78
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
79
8
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
80 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
81 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
82 document.body.appendChild(updateStats.domElement);
3
4bcac064db6c 4th commit
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 2
diff changeset
83 c = document.getElementById("example");
15
80789d11de5c add function for text draw
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 14
diff changeset
84 canvas4text = document.getElementById("textCanvas");
80789d11de5c add function for text draw
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 14
diff changeset
85 ctext = canvas4text.getContext("2d");
2
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
86 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
87 c.height = HEIGHT;
13
74dc1d5f2e47 can select music
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
88 cursor.reset();
74dc1d5f2e47 can select music
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
89 ctx = init();
15
80789d11de5c add function for text draw
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 14
diff changeset
90
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
91 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
92 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
93 return function(){
8
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
94 while((new Date).getTime()>nextGameTick){
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
95 updateStats.update();
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
96 gameUpdate();
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
97 nextGameTick += Interval;
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
98 }
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
99 renderStats.update();
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
100 gameRender(ctx);
15
80789d11de5c add function for text draw
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 14
diff changeset
101
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
102 };
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 })();
13
74dc1d5f2e47 can select music
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
104
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
105 toTitle();
2
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
106 loadSounds();
13
74dc1d5f2e47 can select music
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
107 loadMusicFiles();
15
80789d11de5c add function for text draw
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 14
diff changeset
108 dummyPlay();
8
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
109 }
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
110
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
111 function gameStart(){
15
80789d11de5c add function for text draw
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 14
diff changeset
112 setInterval(loop,10);
8
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
113 }
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
114
8
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
115 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
116 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
117 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
118 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
119 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
120 parseXml(gl);
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
121
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
122 return gl;
8
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
123 }
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
124
2
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
125
8
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
126 width = -1;
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
127 height = -1;
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
128
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
129 function reshape(ctx)
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
130 {
3
4bcac064db6c 4th commit
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 2
diff changeset
131 width = c.width;
4bcac064db6c 4th commit
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 2
diff changeset
132 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
133
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
134 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
135
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
136 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
137 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
138 }
040c922bd7ff keyChar -> keyCode,add sounds
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
139
2
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
140 </script>
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
141 <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
142 canvas {
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
143 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
144 }
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
145 </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
146 <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
147 <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
148 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
149 </canvas>
16
b322a8557f93 draw text
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
150 <canvas id="textCanvas" style="display:none;">
15
80789d11de5c add function for text draw
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents: 14
diff changeset
151 </canvas>
2
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
152 <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
153 </body>
55702e139f69 3rd,show Notes and set Timing, but it is not completely.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
154 </html>