Skip to content

Instantly share code, notes, and snippets.

@noboko
noboko / _app.js
Created March 4, 2013 14:09
Plaskでunderscore.js使ってみるテスト
//npm install underscore
var plask = require('plask');
_ = require('underscore');
plask.simpleWindow({
init: function() {
this.framerate(60);
this.paint.setFill(); // Fill is the default, so this is just for clarity.
this.paint.setAntiAlias(true);
},
@noboko
noboko / app.fshader
Created January 31, 2013 16:37
npmでtimbreインストールした後、Plaskからtimbre使ってみるテスト。 別にそれぞれ連動させたわけじゃなくて、timbreのサンプルをplaskのサンプルに書き足しただけ。
#ifdef GL_ES
precision highp float;
#endif
varying vec4 vColor;
void main(void) {
gl_FragColor = vColor;
}
@noboko
noboko / app.js
Created April 24, 2012 17:07
Learning WebGL for Plask Lesson 16
//Learning WebGL for Plask Lesson16
//Learing WebGL : http://learningwebgl.com/blog/?page_id=1217
//Github : https://github.com/gpjt/webgl-lessons (this script use 'earth.jpg' , 'crate.gif' and 'macbook.json')
//
//Plask : http://www.plask.org/
//
//俺俺でMat3とMat4.toInverseMat3()あたりを追記したものを使ってやりました。
//元のplask.jsと区別つけるために同一フォルダから読み込むようにしてます。
//尚、binary版とgithubの最新版で微妙にplask.jsの変更があるみたいなので、
//plask_.js binary版用、plask.js github用としてます。
@noboko
noboko / app.js
Created April 14, 2012 14:17
Learning WebGL for Plask Lesson 15
//Learning WebGL for Plask Lesson14
//Learing WebGL : http://learningwebgl.com/blog/?page_id=1217
//Github : https://github.com/gpjt/webgl-lessons (this script use 'earth.jpg' and 'earth-specular.gif')
//
//KeyMap
//zoom : qe,
//lighting : t,
//colorMap : y
//useColorMap : u,
//reset : r,
@noboko
noboko / app.js
Created April 14, 2012 11:46
Learning WebGL for Plask lesson 14
//Learning WebGL for Plask Lesson14
//Learing WebGL : http://learningwebgl.com/blog/?page_id=1217
//Github : https://github.com/gpjt/webgl-lessons (this script use 'earth.jpg' , 'arroway.de_metal+structure+06_d100_flat.jpg' and 'Teapot.json')
//zoom : qe,
//lighting : v,
//useFragmentLighting : f
//useTexture : c,
//reset : r,
//specularColor : tgyhuj,
//
//Mat3 for Plask
//Add your plask.js
////////Change your plask.js makeSetter and add exports.Mat3//////////////
function makeSetter(type, loc) {
switch (type) {
case gl.BOOL: // NOTE: bool could be set with 1i or 1f.
case gl.INT:
case gl.SAMPLER_2D:
@noboko
noboko / app.js
Created April 12, 2012 13:43
Learning WebGL for Plask Lesson 13
//Learning WebGL for Plask Lesson13
//Learing WebGL : http://learningwebgl.com/blog/?page_id=1217
//Github : https://github.com/gpjt/webgl-lessons (this script use 'moon.gif' & 'crate.gif'.)
//zoom : qe,
//lighting : v,
//useFragmentLighting : f
//useTexture : c,
//reset : r を割り当ててます。
//plaskで入力エリアを作る方法が無さげなのでtgyhujに平行光の色だけ割り当ててます。
//
@noboko
noboko / app.fshader
Created April 11, 2012 17:24
Learning WebGL for Plask Lesson12
#ifdef GL_ES
precision highp float;
#endif
varying vec2 vTextureCoord;
varying vec3 vLightWeighting;
uniform sampler2D uSampler;
void main(void) {
vec4 textureColor = texture2D(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));
@noboko
noboko / app.fshader
Created April 9, 2012 11:45
Learning WebGL for Plask Lesson 11
#ifdef GL_ES
precision highp float;
#endif
varying vec2 vTextureCoord;
varying vec3 vLightWeighting;
uniform sampler2D uSampler;
void main(void) {
vec4 textureColor = texture2D(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));
@noboko
noboko / app.fshader
Created April 7, 2012 14:08
Learning WebGL for Plask Lesson 10
#ifdef GL_ES
precision highp float;
#endif
varying vec2 vTextureCoord;
uniform sampler2D uSampler;
void main(void) {
gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));
}