Featured Projects

Installation

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

Basic Example

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);
  }
});

Result

Getting Started

Packages Reference

Examples

color.Color.lerp

color.Color.spectrum

fx.SSAO

gen.Cube

gen.IsoSurface

gen.LineBuilder

gen.Loft

gen.Primitives

gen.Sphere

geom.Geometry

geom.Geometry.catmullClark

geom.Geometry.dooSabin

geom.Geometry.extrude

geom.Geometry.generateSurfacePoints

geom.Geometry.generateVolumePoints

geom.Geometry.subdivideEdges

geom.Geometry.triangulate

geom.Geometry.wire

geom.Octree

geom.Path

geom.Path.getClosestPoint

geom.Quat.fromDirection

geom.Ray.hitTestTriangle

glu.Arcball

glu.Arcball.pannning

glu.Mesh.drawInstances

glu.Mesh.position

glu.Mesh.primitiveTypes

glu.RenderTarget

glu.RenderTarget.customTextures

glu.RenderTarget.multipleRenderTargets

glu.Texture2D.genNoise

glu.Texture2D.lod

glu.TextureCube

glu.TextureCube.lod

glu.TextureCube.mipmap

gui.GUI

gui.GUI.colorPalette

gui.GUI.textureList

helpers.All

materials.All

materials.All.spaceTransformations

materials.Textured

materials.TexturedCubeMap

materials.TexturedEnvMap

random.noise3

Contributors

Marcin Ignac, Dean McNamee, Szymon Kaliski, Nick Nickolov, Dawid Górny