Changeset 29983 for lang/javascript/jscloth
- Timestamp:
- 02/12/09 23:58:28 (4 years ago)
- Location:
- lang/javascript/jscloth/trunk
- Files:
-
- 8 modified
-
cloth.js (modified) (10 diffs)
-
index.html (modified) (2 diffs)
-
miku.html (modified) (2 diffs)
-
miku.js (modified) (9 diffs)
-
parpevision.js (modified) (10 diffs)
-
touch.html (modified) (2 diffs)
-
touch.js (modified) (2 diffs)
-
touchdat/tex2.png (modified) (1 prop) (previous)
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/jscloth/trunk/cloth.js
r29905 r29983 73 73 ClothApp.zsortCmp = function(t1, t2) { 74 74 return t2.sortKey - t1.sortKey; 75 } 75 }; 76 76 77 77 ClothApp.prototype = { … … 134 134 var nlen = this.mNodes.length; 135 135 var i, nd; 136 for (i = 0;i < nlen;i++)136 for (i = 0;i < nlen;i++) 137 137 { 138 138 nd = this.mNodes[i]; … … 151 151 this.applyTension(); 152 152 153 for (i = 0;i < nlen;i++)153 for (i = 0;i < nlen;i++) 154 154 { 155 155 nd = this.mNodes[i]; … … 169 169 var nlen = this.mNodes.length; 170 170 var i, nd; 171 for (i = 0;i < nlen;i++)171 for (i = 0;i < nlen;i++) 172 172 { 173 173 nd = this.mNodes[i]; … … 236 236 } 237 237 } 238 } 238 } 239 239 }, 240 240 … … 262 262 var cols = 9; 263 263 var rows = 8; 264 264 265 265 var step = 22; 266 266 this.mNLen = step*0.9; … … 316 316 var nlen = this.mNodes.length; 317 317 318 for (i = 0;i < nlen;i++)318 for (i = 0;i < nlen;i++) 319 319 { 320 320 nd = this.mNodes[i]; … … 382 382 383 383 t.poss[0] = new Vec3(ox + x*sz , by, oz + y*sz + sz); 384 t.poss[1] = new Vec3(ox + x*sz + sz, by, oz + y*sz );384 t.poss[1] = new Vec3(ox + x*sz + sz, by, oz + y*sz ); 385 385 t.poss[2] = new Vec3(ox + x*sz + sz, by, oz + y*sz + sz); 386 386 … … 467 467 } 468 468 } 469 } 469 }; 470 470 471 471 function ClothNode() … … 486 486 this.poss = new Array(3); 487 487 this.tposs = [new Vec3(), new Vec3(), new Vec3()]; 488 this.uvs = [{u:0, v:0}, {u:0, v:0}, {u:0, v:0}];488 this.uvs = [{u:0, v:0}, {u:0, v:0}, {u:0, v:0}]; 489 489 this.shade = 0; 490 490 this.lighting = true; -
lang/javascript/jscloth/trunk/index.html
r29905 r29983 3 3 <html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja"> 4 4 <head> 5 <meta name="viewport" content="width=480, user-scalable=no" /> 5 <meta name="viewport" content="width=480, user-scalable=no" /> 6 6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 7 7 <meta http-equiv="Content-Style-Type" content="text/css" /> … … 42 42 <title>js cloth</title> 43 43 </head> 44 <body onload="void ( new ClothApp());">44 <body onload="void new ClothApp();"> 45 45 <div> 46 46 <canvas id="cv" width="480" height="300"></canvas> -
lang/javascript/jscloth/trunk/miku.html
r29905 r29983 3 3 <html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja"> 4 4 <head> 5 <meta name="viewport" content="width=480, user-scalable=no" /> 5 <meta name="viewport" content="width=480, user-scalable=no" /> 6 6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 7 7 <meta http-equiv="Content-Style-Type" content="text/css" /> … … 43 43 <title>js miku</title> 44 44 </head> 45 <body onload="void ( new MikuApp());">45 <body onload="void new MikuApp();"> 46 46 <div> 47 47 <canvas id="cv" width="480" height="300"></canvas> -
lang/javascript/jscloth/trunk/miku.js
r29905 r29983 122 122 this.mTickCount++; 123 123 var _this = this; 124 setTimeout( function(){_this.onInterval();}, 20);124 setTimeout(function(){_this.onInterval();}, 20); 125 125 }, 126 126 … … 133 133 mViewRot.transpose33(); 134 134 var spos = [0,0,0,0]; 135 135 136 136 mViewRot.transVec3(spos, 0, 0, 5000); 137 137 this.mAllMat.transVec3(spos, spos[0], -100, spos[2]); … … 202 202 var p = new Vec3(); 203 203 var pi = 0, ti = 0, spos = new Array(4); 204 204 205 205 var gi = 0, grest; 206 206 … … 209 209 model.enterGroupTransform(0); 210 210 211 var i; 211 212 for (i = 0;i < len;i++) { 212 213 p.x = poss[pi ]; … … 291 292 mesh.offset_applied = true; 292 293 } 293 } 294 }; 294 295 295 296 function MikuModel(transformContext) … … 318 319 enterGroupTransform: function(gi) { 319 320 var w, t, u; 320 switch (gi) {321 switch (gi) { 321 322 case 0: 322 323 { … … 373 374 leaveGroupTransform: function(gi) { 374 375 } 375 } 376 }; 376 377 377 378 var MESH_FLOOR = { … … 381 382 poss: [ 382 383 -120, -100, -120, 383 0 ,-100, -120,384 -120, -100, 0,385 0 , -100,0,384 0, -100, -120, 385 -120, -100, 0, 386 0, -100, 0, 386 387 -120, -100, 120, 387 0 ,-100, 120,388 0, -100, 120, 388 389 389 390 120, -100, -120, … … 392 393 ], 393 394 texcoords: [ 394 0, 0 ,395 0.5, 0 ,395 0, 0, 396 0.5, 0, 396 397 0, 0.5, 397 398 0.5, 0.5, 398 399 0, 1, 399 400 0.5, 1, 400 1, 0,401 1, 0.5,402 1, 1401 1, 0, 402 1, 0.5, 403 1, 1 403 404 ], 404 405 indices: [ -
lang/javascript/jscloth/trunk/parpevision.js
r29905 r29983 34 34 g.fillRect(0, 0, w, h); 35 35 36 } 36 }; 37 37 38 38 P3D.num_cmp = function(a,b){return a-b;} … … 43 43 44 44 var g = this.g; 45 45 46 46 var vAd = [ poss[1].x - poss[0].x , poss[1].y - poss[0].y ]; 47 47 var vBd = [ poss[2].x - poss[0].x , poss[2].y - poss[0].y ]; … … 111 111 112 112 return true; 113 } 113 }; 114 114 115 115 P3D.drawTestByIndexBuffer = function(pos_buf, ix_buf, culling) { … … 201 201 202 202 var vCd = [ poss[2].x - poss[1].x , poss[2].y - poss[1].y ]; 203 203 204 204 // z component of cross product < 0 ? 205 205 if( (((vAd[0] * vCd[1]) - (vAd[1] * vCd[0]))*culling) < 0) … … 232 232 233 233 var im = m.getInvert(); 234 if (!im) { continue;}234 if (!im) {continue;} 235 235 236 236 var a = im._11 * vAd[0] + im._12 * vBd[0]; … … 341 341 }, 342 342 343 dpWith: function(v) {343 dpWith: function(v) { 344 344 return this.x*v.x + this.y*v.y + this.z*v.z; 345 345 }, … … 356 356 return this.x + ", " + this.y + "," + this.z; 357 357 } 358 } 358 }; 359 359 360 360 function M44(cpy) … … 443 443 var aX = new Vec3(); 444 444 var aY = new Vec3(); 445 445 446 446 var aZ = new Vec3(aAt.x, aAt.y, aAt.z); 447 447 aZ.sub(aFrom).normalize(); 448 448 449 449 aX.cp(aUp, aZ).normalize(); 450 450 aY.cp(aZ, aX); 451 451 452 452 this._11 = aX.x; this._12 = aY.x; this._13 = aZ.x; this._14 = 0; 453 453 this._21 = aX.y; this._22 = aY.y; this._23 = aZ.y; this._24 = 0; 454 454 this._31 = aX.z; this._32 = aY.z; this._33 = aZ.z; this._34 = 0; 455 455 456 456 this._41 = -aFrom.dpWith(aX); 457 457 this._42 = -aFrom.dpWith(aY); 458 458 this._43 = -aFrom.dpWith(aZ); 459 459 this._44 = 1; 460 460 461 461 return this; 462 462 }, … … 573 573 } 574 574 575 } 575 }; 576 576 577 577 // matrix 2x2 … … 598 598 599 599 return out; 600 } 600 }; -
lang/javascript/jscloth/trunk/touch.html
r29905 r29983 3 3 <html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja"> 4 4 <head> 5 <meta name="viewport" content="width=480, user-scalable=no" /> 5 <meta name="viewport" content="width=480, user-scalable=no" /> 6 6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 7 7 <meta http-equiv="Content-Style-Type" content="text/css" /> … … 43 43 <title>js iPod touch</title> 44 44 </head> 45 <body onload="void ( new TouchApp());">45 <body onload="void new TouchApp();"> 46 46 <div> 47 47 <canvas id="cv" width="480" height="300"></canvas> -
lang/javascript/jscloth/trunk/touch.js
r29905 r29983 146 146 drawFloor: function() { 147 147 P3D.texture = this.texture2; 148 // console.log(MESH_floor.tl_poss[2] + " " + MESH_floor.tl_poss[6]) 148 // console.log(MESH_floor.tl_poss[2] + " " + MESH_floor.tl_poss[6]); 149 149 P3D.drawByIndexBuffer(MESH_floor.tl_poss, MESH_floor.face_groups[0], MESH_floor.texcoords, -1, true); 150 150 } 151 } 151 }; 152 152 153 153 function iPodModel(mesh) { … … 274 274 } 275 275 } 276 } 276 }; -
lang/javascript/jscloth/trunk/touchdat/tex2.png
- Property svn:mime-type changed from application/octet-stream to image/png
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)