This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[damele0n](http://jsdo.it/damele0n)さんの[おっぱいがうごくJS](http://jsdo.it/damele0n/h8BW)を参考に、新しく作ってみた。 | |
(あ、案件で使うときがあったので・・w) | |
主な実装内容は、胸のあたりに5x5程度のメッシュを作成し、テクスチャマッピングした各頂点を揺らす、ということで実装しています。 | |
[History] | |
* [2013/03/04] 常にレンダリングし続けるのを防ぎ、CPU使用率を下げるよう修正しました。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defaults = | |
param1: 'hoge' | |
param2: 'fuga' | |
param3: 'foo' | |
param4: 'bar' | |
param5: 'baz' | |
obj = {} | |
obj[p] = defaults[p] for p of defaults |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fs = require 'fs' | |
util = require 'util' | |
{spawn, exec} = require 'child_process' | |
option '-o', '--output [DIR]', 'Output directory.' | |
option '-t', '--target [DIR]', 'Watch target directory.' | |
stdout_handler = (data) -> | |
console.log data.toString().trim() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Disposal | |
constructor: -> | |
dispose: -> | |
@el?.parentNode?.removeChild @el | |
@el = null | |
@off?() | |
@disposeInternal.apply @, arguments | |
disposeInternal: -> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#PerlinNoiseを使った稲妻表現 | |
マウスをY軸の中央に近づけると雷が荒ぶるようにしてみました。 | |
--- | |
[akm2さん](http://jsdo.it/akm2)の[Lightning](http://jsdo.it/akm2/pQbM)を参考に、 | |
ノイズで稲妻を作る部分だけを実装してみました。 | |
ちなみに、上記のコードを[自分なりにコメントを付けて分析したもの](http://jsdo.it/edo_m18/zzcN)もあります。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (win, doc, exports, undefined) { | |
'use strict'; | |
var fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/; | |
function Class() { /* noop. */ } | |
Class.extend = function (props) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Canvas context 2Dでポリゴンを描く | |
------- | |
【更新履歴】 | |
- 2013.04.13 | |
Matrixのupdateを最適化しました。 | |
- 2013.04.12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Quaternionを使って3D回転を表現 | |
独自のCameraクラスなどを使って、銀河系的な表現に挑戦。 | |
##更新履歴 | |
* Z軸の値を換算し、前後関係を解決後にレンダリングするよう修正 | |
* iOSにも対応しました。ピンチイン・アウトで視点が近づいたり遠のいたりします。 | |
* ドラッグで視点移動ができ、またホイールで視点が近づいたり遠のいたりします。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (win, doc, exports, undefined) { | |
'use strict'; | |
var fnTest, initialize; | |
fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/; | |
initialize = false; | |
function Class() { /* noop. */ } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (win, doc, exports, undefined) { | |
'use strict'; | |
var fnTest, initialize; | |
fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/; | |
initialize = false; | |
function Class() { /* noop. */ } |