My name is Mani.
I'm a technologist, artist & musician,
currently working out of Pioneer Works tech lab on a VR interactive narrative.
Procedural thinking, Interaction Design
drawBlendImageFromBuffer(buffer) {
this.blendImageData
.data
.set(
new Uint8ClampedArray(buffer)
);
this.blendCanvasCtx.putImageData(this.blendImageData, 0, 0);
this.previousImageData = this.currentImageData;
}
// bitwise Math.round
export const round = (number) => (number + .5) >> 0;
// butwise Math.abs
export const abs = (value) => (value ^ (value >> 31)) - (value >> 31);
import { create } from 'diffyjs';
const diffy = create({
resolution: { x: 15, y: 10 },
sensitivity: 0.2,
threshold: 25,
debug: true,
containerClassName: 'my-diffy-container',
sourceDimensions: { w: 130, h: 100 },
onFrame: (matrix) => { /* stuff */ }
});
compare(frame1, frame2) {
const data1 = frame1.data;
const data2 = frame2.data;
const length = data1.length;
const buffer = new ArrayBuffer(length);
this.worker.postMessage({
buffer,
data1,
data2,
sensitivity: this.sensitivity,
threshold: this.threshold,
width: this.sourceWidth,
height: this.sourceHeight
});
}
Diffy won't scale well on larger matrices,
because the Big-O time complexity is O(n²)
Why can't we be friends?
asm.js is a subset of JavaScript designed to allow computer software written in languages such as C to be run as web applications while maintaining performance characteristics considerably better than standard JavaScript, the typical language used for such applications
Rust is a systems programming language sponsored by Mozilla which describes it as a "safe, concurrent, practical language," supporting functional and imperative-procedural paradigms.
> cargo new my-awesome-project
Created binary (application) `my-awesome-project` project
> cargo run
Compiling my-awesome-project v0.1.0 (file:///Users/maninilchiani/Workspace/rust/my-awesome-project)
Finished dev [unoptimized + debuginfo] target(s) in 1.62s
Running `target/debug/my-awesome-project`
Hello, world!
Facilitates high-level interactions between wasm modules and JavaScript. Generates glue code for JS and Rust interoperability.
I mean, we *can*