is a set of JavaScript libraries for computational thinking in Plask/Node.js and WebGL in the browser.
Pex is using node.js and npm
npm install pex -g
pex init demo-project
cd demo-project
npm install
npm run watch
open index.html
var sys = require('pex-sys');
var glu = require('pex-glu');
var materials = require('pex-materials');
var gen = require('pex-gen');
var Color = require('pex-color').Color;
sys.Window.create({
init: function() {
var cube = new gen.Cube();
this.material = new materials.ShowNormals();
this.mesh = new glu.Mesh(cube, this.material);
var aspectRatio = this.width / this.height;
this.camera = new glu.PerspectiveCamera(60, aspectRatio);
this.arcball = new glu.Arcball(this, this.camera);
},
draw: function() {
glu.clearColorAndDepth(Color.White);
glu.enableDepthReadAndWrite(true);
this.mesh.draw(this.camera);
}
});