Skip to content

Instantly share code, notes, and snippets.

import bpy
import bmesh
import random
from mathutils import Vector, noise, Matrix
from math import sin, cos, tau, pi, radians, sqrt
from utils.interpolation import *
from utils.math import *
from utils.color import *
frame_start = 1
@Dan-Piker
Dan-Piker / Moebius3d
Last active March 27, 2024 08:06
Moebius transformations in 3d
//Moebius transformations in 3d, by reverse stereographic projection to the 3-sphere,
//rotation in 4d space, and projection back.
//by Daniel Piker 09/08/20
//Feel free to use, adapt and reshare. I'd appreciate a mention if you post something using this.
//You can also now find this transformation as a component in Grasshopper/Rhino
//I first wrote about these transformations here:
//https://spacesymmetrystructure.wordpress.com/2008/12/11/4-dimensional-rotations/
//If you want to transform about a given circle. Points on the circle and its axis stay on those curves.
//You can skip these 2 lines if you want to always use the origin centred unit circle.
#!/bin/sh
# From http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html
# Usage:
# ./makegif.sh inputframes output.gif
# where inputframes is a directory containing .png frames
# Change size here
filters="scale=640:-1:flags=lanczos"
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
if (p < 0.5)
return 0.5 * pow(2*p, g);
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
if (p < 0.5)
return 0.5 * pow(2*p, g);
'use strict'
var gif, canvElt,
numFrames = 30,
duration = 1200,
recording = true,
time = 0
;
function setup() {
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
if (p < 0.5)
return 0.5 * pow(2*p, g);
int seed = int(random(999999));
void setup() {
size(960, 960, P3D);
smooth(8);
pixelDensity(2);
generate();
}
@beesandbombs
beesandbombs / blockWave.pde
Created January 24, 2018 17:33
block wave
// block wave by davey
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
// note : if you're on github gist and want to copy paste this code, you can click on the "Raw" button
// and then do Ctrl A, Ctrl C, Ctrl V
// (code below by Kurt Spencer, slightly modified code to run as Processing tab)
// maybe you should rather use this new (improved) version of the noise instead : https://github.com/KdotJPG/OpenSimplex2
/*
* OpenSimplex Noise in Java.
* by Kurt Spencer
*
* v1.1 (October 5, 2014)