Skip to content

Instantly share code, notes, and snippets.

@Justinfront
Justinfront / Unicorn
Last active September 20, 2016 16:36
package;
import kha.FastFloat;
import kha.Framebuffer;
import kha.math.FastMatrix3;
import kha.Scheduler;
import kha.System;
import js.Lib;
import js.html.ImageElement;
import js.html.Event;
function turn (X, Y) {
// for the math, see http://www.texpaste.com/n/ev3443eo
var
X2 = X*X, Y2 = Y*Y,
q = 1 + X2 + Y2,
s = 1 - X2 - Y2,
r2 = 1/(q*q), s2 = s*s,
A = (s2 + 4*(Y2 - X2))*r2, B = -8*X*Y*r2, C = 4*s*X*r2,
D = (s2 + 4*(X2 - Y2))*r2, E = 4*s*Y*r2,
F = (s2 - 4*(X2 + Y2))*r2;
@Justinfront
Justinfront / links_wwwx2016.txt
Last active December 19, 2017 09:09
wwwx 2016 links ( slides )