Skip to content

Instantly share code, notes, and snippets.

@andyli
andyli / haxe-svn.sh
Created June 8, 2012 12:05
Compile and deploy haxe from svn on Mac
sudo cd .
cd /Users/andy/Documents/repo/haxe #the already checked out haxe svn
svn update
make
echo "Compilation done!"
sudo rm -f /usr/lib/haxe/haxe
sudo rm -f /usr/lib/haxe/haxelib
sudo rm -f /usr/lib/haxe/haxedoc
@andyli
andyli / Demo1.hx
Created April 12, 2012 15:11
map points between two triangles in 3D space
// map points between two triangles in 3D space
// http://stackoverflow.com/questions/3780493/map-points-between-two-triangles-in-3d-space/4679651#4679651
package;
import processing.core.PApplet;
import processing.core.PConstants;
import toxi.geom.Matrix4x4;
import toxi.geom.Vec3D;
@andyli
andyli / FluidSolver.hx
Created June 11, 2011 15:33
onthewings.stuffs.stuff15
package;
/***********************************************************************
* This is a class for solving real-time fluid dynamics simulations based on Navier-Stokes equations
* and code from Jos Stam's paper "Real-Time Fluid Dynamics for Games" http://www.dgp.toronto.edu/people/stam/reality/Research/pdf/GDC03.pdf
* Other useful resources and implementations I looked at while building this lib:
* Mike Ash (C) - http://mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html
* Alexander McKenzie (Java) - http://www.multires.caltech.edu/teaching/demos/java/stablefluids.htm
* Pierluigi Pesenti (AS3 port of Alexander's) - http://blog.oaxoa.com/2008/01/21/actionscript-3-fluids-simulation/
//A backup of http://lists.motion-twin.com/pipermail/haxe/2009-July/027010.html
/**
* Memory Layout:
* Block size b = DATA_SIZE * (N + 2) * (M + 2)
* 1. d 0 ... b-1
* 2. d_prev b ... 2b-1
* 3. u 2b ... 3b-1
* 4. u_prev 3b ... 4b-1
* 5. v 4b ... 5b-1
* 6. v_prev 5b ... 6b-1
@andyli
andyli / Main.hx
Created May 11, 2011 18:21
onthewings.stuffs.stuff14
/**
* Some of the renderings can be found at
* http://www.flickr.com/photos/andy-li/sets/72157625719497466/
*
*
* Copyright (c) 2011, Andy Li http://www.onthewings.net/
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
@andyli
andyli / Main.hx
Created May 3, 2011 15:50
onthewings.stuffs.stuff13
/**
* Some of the renderings can be found at
* http://www.flickr.com/photos/andy-li/sets/72157625719497466/
*
*
* Copyright (c) 2011, Andy Li http://www.onthewings.net/
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
@andyli
andyli / Main.hx
Created April 10, 2011 19:54
onthewings.stuffs.stuff12
/**
* Some of the renderings can be found at
* http://www.flickr.com/photos/andy-li/sets/72157625719497466/
*
*
* Copyright (c) 2011, Andy Li http://www.onthewings.net/
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
@andyli
andyli / Main.hx
Created April 8, 2011 15:11
onthewings.stuffs.stuff11
/**
* Some of the renderings can be found at
* http://www.flickr.com/photos/andy-li/sets/72157625719497466/
*
*
* Copyright (c) 2011, Andy Li http://www.onthewings.net/
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
@andyli
andyli / Main.hx
Created April 4, 2011 07:41
onthewings.stuffs.stuff10
/**
* Some of the renderings can be found at
* http://www.flickr.com/photos/andy-li/sets/72157625719497466/
*
*
* Copyright (c) 2011, Andy Li http://www.onthewings.net/
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
@andyli
andyli / Main.hx
Created March 8, 2011 11:40
onthewings.stuffs.stuff9
/**
* Some of the renderings can be found at
* http://www.flickr.com/photos/andy-li/sets/72157625719497466/
*
*
* Copyright (c) 2011, Andy Li http://www.onthewings.net/
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met: