Skip to content

Instantly share code, notes, and snippets.

View mikolalysenko's full-sized avatar

Mikola Lysenko mikolalysenko

View GitHub Profile
@mikolalysenko
mikolalysenko / gist:113ba3f8f5bf14f74d6c
Last active August 29, 2015 14:06
CampJS description

Learn WebGL!

webgl-workshop covers the basics of WebGL development from the ground up. Starting from shader programming, students will learn how to use the WebGL API to create interactive, high performance graphical web applications. Lessons follow the nodeschool convention of short, guided exercises with interactive feedback.

stackgl is an open software ecosystem for WebGL, built on top of browserify and npm. Inspired by the Unix philosophy, stackgl modules "do one thing, and do it well". It is easy to use parts of stackgl à la carte, and because it is written from the bottom up, you can always drill down a layer. Unlike many 3D engines, stackgl emphasizes writing shader code, and provides powerful tools like glslify which bring the modularity and power of npm to GLSL!

@mikolalysenko
mikolalysenko / index.js
Created March 18, 2015 22:07
requirebin sketch
var createScene = require('gl-plot3d')
var createScatter = require('gl-scatter3d')
var bunny = require('bunny')
var scene = createScene()
var scatter = createScatter({
gl: scene.gl,
position: bunny.positions,
size: 10,
@mikolalysenko
mikolalysenko / index.js
Created March 18, 2015 22:50
requirebin sketch
var createScene = require('gl-plot3d')
var createLine = require('gl-line3d')
var scene = createScene()
var points = []
for(var t = 0; t< 1000; ++t) {
var theta = Math.PI * t / 200.0
points.push([Math.cos(theta), 0.002 * t, Math.sin(theta)])
}
@mikolalysenko
mikolalysenko / index.js
Last active August 29, 2015 14:17
requirebin sketch
var createScene = require('gl-plot3d')
var createSurfacePlot = require('gl-surface3d')
var ndarray = require('ndarray')
var fill = require('ndarray-fill')
var diric = require('dirichlet')
var scene = createScene()
//Initialize surface data
var field = ndarray(new Float32Array(512*512), [512,512])
@mikolalysenko
mikolalysenko / index.js
Last active August 29, 2015 14:17
requirebin sketch
var createScene = require('gl-plot3d')
var createSurface = require('gl-surface3d')
var ndarray = require('ndarray')
var scene = createScene()
var size = 64
var coords = [
ndarray(new Float32Array(4*(size+1)*(size+1)), [2*size+1,2*size+1]),
ndarray(new Float32Array(4*(size+1)*(size+1)), [2*size+1,2*size+1]),
@mikolalysenko
mikolalysenko / index.js
Last active August 29, 2015 14:17
requirebin sketch
var createScene = require('gl-plot3d')
var createMesh = require('gl-mesh3d')
var bunny = require('bunny')
var scene = createScene()
var mesh = createMesh({
gl: scene.gl,
cells: bunny.cells,
positions: bunny.positions,
@mikolalysenko
mikolalysenko / index.js
Created March 18, 2015 23:05
requirebin sketch
var createScene = require('gl-plot3d')
var createMesh = require('gl-mesh3d')
var bunny = require('bunny')
var sc = require('simplicial-complex')
var scene = createScene()
var mesh = createMesh({
gl: scene.gl,
cells: sc.skeleton(bunny.cells, 1),

I should not tell you of Berenice, the unjust city, which crowns with triglyphs, abaci, metopes the gears of its meat-grinding machines (the men assigned to polishing, when they raise their chins over the balustrades and contemplate the atria, stairway, porticos, feel even more imprisoned and short of stature). Instead, I should tell you of the hidden Berenice, the city of the just, handling makeshift materials in the shadowy rooms behind the shops and beneath the stairs, linking a network of wires and pipes, pulleys and pistons and counterweights that infiltrates like a climbing plant among the great cogged wheels (when they jam, a subdued ticking gives warning that a new precision mechanism is governing the city). Instead of describing to you the perfumed pools of the baths where the unjust of Berenice recline and weave their intrigues with rotund eloquence and observe with a proprietary eye the rotund flesh of the bathing odalisques, I should say to you how the just, always cautious to evade the spying syc

@mikolalysenko
mikolalysenko / index.js
Last active August 29, 2015 14:18
requirebin sketch
//Hacky experiment with Ken Clarkson-style L1 shortest path finding
// This sketch just visualizes the graph/data structures which are built by the algorithm.
// The green node is the source node and the red is the sink
// Magenta nodes/edges are nodes in the graph which is searched
// The total number of magenta nodes/edges is at most O(n log(n)), n = number of corners
// Worst case time to search the graph using A* is O(n log^2(n)), but in practice it might
// be way faster.
//
// Reference:
// "Rectilinear shortest paths through polygonal obstacles". K.L. Clarkson, S. Kapoor, P.M. Vaidya.