Skip to content

Instantly share code, notes, and snippets.

View pinkwerks's full-sized avatar
💭
Environment aware manipulation

Pink Bobsledder pinkwerks

💭
Environment aware manipulation
View GitHub Profile
private List<Vector3> UniformGrid(Vector3Int numDivisions, Vector3 gridPosition, float scale = 1)
{
Assert.IsTrue(numDivisions.x > 0);
Assert.IsTrue(numDivisions.y > 0);
Assert.IsTrue(numDivisions.z > 0);
var count = numDivisions.x * numDivisions.y * numDivisions.z;
List<Vector3> gridResult = new List<Vector3>(count);
for (int i = 0; i < count; ++i)
{
var position = new Vector3
@pinkwerks
pinkwerks / SBCL Caveman Win 10 64.txt
Last active January 17, 2017 18:32
Lisp: Bootstrapping SBCL + Caveman on Win 10 64
The single most important thing is to make and install emacs and gcc to a path without spaces!
This means, when prompted, to customize your path. Be sane and use c:\ !
Get and install emacs (unzip to a path with no spaces!)
Install 64bit MinGW
Be sure to select x86_64 for the Architecture (not i686!) when prompted
https://sourceforge.net/projects/mingw-w64/?source=typ_redirect
Install openssl
float frequency = .5;
float trianglewave = abs(2 * frac(x * frequency) - 1); // repeating triangle wave /\/\/\...
float squarewave = round(abs(2 * frac(x * frequency + .25) - 1)); // repeating square wave
float FilteredStep(float edge, float x, float fw)
{
return saturate((x + fw / 2 - edge) / fw);
}
// Euclid length because built-in does abs(ddx(x)) + abs(ddy(y))
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Hello, World! • A-Frame</title>
<meta name="description" content="Hello, World! • A-Frame">
<script src="https://aframe.io/releases/latest/aframe.min.js"></script>
</head>
<body>
@pinkwerks
pinkwerks / kdtree-nearest-neighbor.py
Last active April 6, 2016 18:41
Nearest neigbor from a point in 3d space
# find nearest neighbor of a point
import numpy as np
from scipy import spatial
# create 10 random points
x, y, z = np.random.rand(3,10)
# format our points for the kdtree function
points = [i for i in zip(x,y,z)]