Skip to content

Instantly share code, notes, and snippets.

@cathode
Created January 11, 2013 22:22
Show Gist options
  • Select an option

  • Save cathode/4514478 to your computer and use it in GitHub Desktop.

Select an option

Save cathode/4514478 to your computer and use it in GitHub Desktop.
private void InitMarchingCubesAlgorithmFancier()
{
// Even fancier. We'll use a LINQ query to build the lookup tables for Marching Cubes.
var result = from i in Enumerable.Range(0, 256)
let f = new Func<int, int>(s => (i & (1 << s)) >> s)
let verts = from j in Enumerable.Range(0, 8)
select f(j)
select verts; // not complete yet
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment