Mercurial > hg > Members > e085711
comparison webGL/dandy/resources/Character.js~ @ 9:1d76f5717ba7
upload dandy4.html
author | NOBUYASU Oshiro |
---|---|
date | Sat, 10 Jul 2010 16:38:10 +0900 |
parents | 03b67cd2bde7 |
children | 680b5b0cd1e4 |
comparison
equal
deleted
inserted
replaced
8:03b67cd2bde7 | 9:1d76f5717ba7 |
---|---|
13 | 13 |
14 function Character() | 14 function Character() |
15 { | 15 { |
16 this.x=0; | 16 this.x=0; |
17 this.y=0; | 17 this.y=0; |
18 this.scale=1.0; | |
18 this.dx=0; | 19 this.dx=0; |
19 this.dy=0; | 20 this.dy=0; |
20 this.w=0; | 21 this.w=0; |
21 this.h=0; | 22 this.h=0; |
22 this.vit=0; | 23 this.vit=0; |
59 | 60 |
60 ctx.bindBuffer(ctx.ELEMENT_ARRAY_BUFFER, glObj.image.indexObject); | 61 ctx.bindBuffer(ctx.ELEMENT_ARRAY_BUFFER, glObj.image.indexObject); |
61 | 62 |
62 // generate the model-view matrix | 63 // generate the model-view matrix |
63 var mvMatrix = new CanvasMatrix4(); | 64 var mvMatrix = new CanvasMatrix4(); |
64 mvMatrix.scale(1, 1, 1); | 65 mvMatrix.scale(jiki.scale, jiki.scale, jiki.scale); |
65 mvMatrix.translate(0,0,0); | |
66 mvMatrix.rotate(180, 0,0,1); | |
67 mvMatrix.translate(glObj.x,glObj.y,10); | 66 mvMatrix.translate(glObj.x,glObj.y,10); |
68 | 67 |
69 // construct the normal matrix from the model-view matrix | 68 // construct the normal matrix from the model-view matrix |
70 var normalMatrix = new CanvasMatrix4(mvMatrix); | 69 var normalMatrix = new CanvasMatrix4(mvMatrix); |
71 normalMatrix.invert(); | 70 normalMatrix.invert(); |